<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-comment">{- |
This module contains the various datatypes which model the state of the line; that is, the characters displayed and the position of the cursor.
-}</span><span>
</span><span id="line-4"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">System.Console.Haskeline.LineState</span><span class="hs-special">(</span><span>
</span><span id="line-5"></span><span>                    </span><span class="annot"><span class="hs-comment">-- * Graphemes</span></span><span>
</span><span id="line-6"></span><span>                    </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#Grapheme"><span class="hs-identifier">Grapheme</span></a></span><span class="hs-special">(</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-7"></span><span>                    </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#baseChar"><span class="hs-identifier">baseChar</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-8"></span><span>                    </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#stringToGraphemes"><span class="hs-identifier">stringToGraphemes</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-9"></span><span>                    </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#graphemesToString"><span class="hs-identifier">graphemesToString</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-10"></span><span>                    </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#modifyBaseChar"><span class="hs-identifier">modifyBaseChar</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-11"></span><span>                    </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#mapBaseChars"><span class="hs-identifier">mapBaseChars</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-12"></span><span>                    </span><span class="annot"><span class="hs-comment">-- * Line State class</span></span><span>
</span><span id="line-13"></span><span>                    </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#LineState"><span class="hs-identifier">LineState</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-14"></span><span>                    </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#Prefix"><span class="hs-identifier">Prefix</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-15"></span><span>                    </span><span class="annot"><span class="hs-comment">-- ** Convenience functions for the drawing backends</span></span><span>
</span><span id="line-16"></span><span>                    </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#LineChars"><span class="hs-identifier">LineChars</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-17"></span><span>                    </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#lineChars"><span class="hs-identifier">lineChars</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-18"></span><span>                    </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#lengthToEnd"><span class="hs-identifier">lengthToEnd</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-19"></span><span>                    </span><span class="annot"><span class="hs-comment">-- ** Supplementary classes</span></span><span>
</span><span id="line-20"></span><span>                    </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#Result"><span class="hs-identifier">Result</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-21"></span><span>                    </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#Save"><span class="hs-identifier">Save</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-22"></span><span>                    </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#listSave"><span class="hs-identifier">listSave</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-23"></span><span>                    </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#listRestore"><span class="hs-identifier">listRestore</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-24"></span><span>                    </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#Move"><span class="hs-identifier">Move</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-25"></span><span>                    </span><span class="annot"><span class="hs-comment">-- * Instances</span></span><span>
</span><span id="line-26"></span><span>                    </span><span class="annot"><span class="hs-comment">-- ** InsertMode</span></span><span>
</span><span id="line-27"></span><span>                    </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#InsertMode"><span class="hs-identifier">InsertMode</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-28"></span><span>                    </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#emptyIM"><span class="hs-identifier">emptyIM</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-29"></span><span>                    </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#insertChar"><span class="hs-identifier">insertChar</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-30"></span><span>                    </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#insertString"><span class="hs-identifier">insertString</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-31"></span><span>                    </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#replaceCharIM"><span class="hs-identifier">replaceCharIM</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-32"></span><span>                    </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#insertGraphemes"><span class="hs-identifier">insertGraphemes</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-33"></span><span>                    </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#deleteNext"><span class="hs-identifier">deleteNext</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-34"></span><span>                    </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#deletePrev"><span class="hs-identifier">deletePrev</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-35"></span><span>                    </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#skipLeft"><span class="hs-identifier">skipLeft</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-36"></span><span>                    </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#skipRight"><span class="hs-identifier">skipRight</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-37"></span><span>                    </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#transposeChars"><span class="hs-identifier">transposeChars</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-38"></span><span>                    </span><span class="annot"><span class="hs-comment">-- *** Moving to word boundaries</span></span><span>
</span><span id="line-39"></span><span>                    </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#goRightUntil"><span class="hs-identifier">goRightUntil</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-40"></span><span>                    </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#goLeftUntil"><span class="hs-identifier">goLeftUntil</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-41"></span><span>                    </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#atStart"><span class="hs-identifier">atStart</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-42"></span><span>                    </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#atEnd"><span class="hs-identifier">atEnd</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-43"></span><span>                    </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#beforeChar"><span class="hs-identifier">beforeChar</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-44"></span><span>                    </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#afterChar"><span class="hs-identifier">afterChar</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-45"></span><span>                    </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#overChar"><span class="hs-identifier">overChar</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-46"></span><span>                    </span><span class="annot"><span class="hs-comment">-- ** CommandMode</span></span><span>
</span><span id="line-47"></span><span>                    </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#CommandMode"><span class="hs-identifier">CommandMode</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-48"></span><span>                    </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#deleteChar"><span class="hs-identifier">deleteChar</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-49"></span><span>                    </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#replaceChar"><span class="hs-identifier">replaceChar</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-50"></span><span>                    </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#pasteGraphemesBefore"><span class="hs-identifier">pasteGraphemesBefore</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-51"></span><span>                    </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#pasteGraphemesAfter"><span class="hs-identifier">pasteGraphemesAfter</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-52"></span><span>                    </span><span class="annot"><span class="hs-comment">-- *** Transitioning between modes</span></span><span>
</span><span id="line-53"></span><span>                    </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#enterCommandMode"><span class="hs-identifier">enterCommandMode</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-54"></span><span>                    </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#enterCommandModeRight"><span class="hs-identifier">enterCommandModeRight</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-55"></span><span>                    </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#insertFromCommandMode"><span class="hs-identifier">insertFromCommandMode</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-56"></span><span>                    </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#appendFromCommandMode"><span class="hs-identifier">appendFromCommandMode</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-57"></span><span>                    </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#withCommandMode"><span class="hs-identifier">withCommandMode</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-58"></span><span>                    </span><span class="annot"><span class="hs-comment">-- ** ArgMode</span></span><span>
</span><span id="line-59"></span><span>                    </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#ArgMode"><span class="hs-identifier">ArgMode</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-60"></span><span>                    </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#startArg"><span class="hs-identifier">startArg</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-61"></span><span>                    </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#addNum"><span class="hs-identifier">addNum</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-62"></span><span>                    </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#applyArg"><span class="hs-identifier">applyArg</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-63"></span><span>                    </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#applyCmdArg"><span class="hs-identifier">applyCmdArg</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-64"></span><span>                    </span><span class="annot"><span class="hs-comment">-- ** Other line state types</span></span><span>
</span><span id="line-65"></span><span>                    </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#Message"><span class="hs-identifier">Message</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-66"></span><span>                    </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#Password"><span class="hs-identifier">Password</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-67"></span><span>                    </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#addPasswordChar"><span class="hs-identifier">addPasswordChar</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-68"></span><span>                    </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#deletePasswordChar"><span class="hs-identifier">deletePasswordChar</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-69"></span><span>                    </span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-70"></span><span>
</span><span id="line-71"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.Char.html#"><span class="hs-identifier">Data.Char</span></a></span><span>
</span><span id="line-72"></span><span>
</span><span id="line-73"></span><span class="hs-comment">-- | A 'Grapheme' is a fundamental unit of display for the UI.  Several characters in sequence</span><span>
</span><span id="line-74"></span><span class="hs-comment">-- can represent one grapheme; for example, an @a@ followed by the diacritic @\'\\768\'@ should</span><span>
</span><span id="line-75"></span><span class="hs-comment">-- be treated as one unit.</span><span>
</span><span id="line-76"></span><span class="hs-keyword">data</span><span> </span><span id="Grapheme"><span class="annot"><a href="System.Console.Haskeline.LineState.html#Grapheme"><span class="hs-identifier hs-var">Grapheme</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="Grapheme"><span class="annot"><a href="System.Console.Haskeline.LineState.html#Grapheme"><span class="hs-identifier hs-var">Grapheme</span></a></span></span><span> </span><span class="hs-special">{</span><span id="gBaseChar"><span class="annot"><span class="annottext">Grapheme -&gt; Char
</span><a href="System.Console.Haskeline.LineState.html#gBaseChar"><span class="hs-identifier hs-var hs-var">gBaseChar</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Char</span></span><span class="hs-special">,</span><span>
</span><span id="line-77"></span><span>                            </span><span id="combiningChars"><span class="annot"><span class="annottext">Grapheme -&gt; [Char]
</span><a href="System.Console.Haskeline.LineState.html#combiningChars"><span class="hs-identifier hs-var hs-var">combiningChars</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="hs-identifier hs-type">Char</span></span><span class="hs-special">]</span><span class="hs-special">}</span><span>
</span><span id="line-78"></span><span>                    </span><span class="hs-keyword">deriving</span><span> </span><span id="local-6989586621679091769"><span id="local-6989586621679091775"><span class="annot"><span class="annottext">Grapheme -&gt; Grapheme -&gt; Bool
(Grapheme -&gt; Grapheme -&gt; Bool)
-&gt; (Grapheme -&gt; Grapheme -&gt; Bool) -&gt; Eq Grapheme
forall a. (a -&gt; a -&gt; Bool) -&gt; (a -&gt; a -&gt; Bool) -&gt; Eq a
/= :: Grapheme -&gt; Grapheme -&gt; Bool
$c/= :: Grapheme -&gt; Grapheme -&gt; Bool
== :: Grapheme -&gt; Grapheme -&gt; Bool
$c== :: Grapheme -&gt; Grapheme -&gt; Bool
</span><span class="hs-identifier hs-var hs-var hs-var hs-var hs-var hs-var">Eq</span></span></span></span><span>
</span><span id="line-79"></span><span>
</span><span id="line-80"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679091763"><span id="local-6989586621679091766"><span class="annot"><a href="../../base/src/GHC.Show.html#Show"><span class="hs-identifier hs-type">Show</span></a></span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#Grapheme"><span class="hs-identifier hs-type">Grapheme</span></a></span></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-81"></span><span>    </span><span id="local-6989586621679091757"><span class="annot"><span class="annottext">show :: Grapheme -&gt; [Char]
</span><a href="../../base/src/GHC.Show.html#show"><span class="hs-identifier hs-var hs-var hs-var hs-var">show</span></a></span></span><span> </span><span id="local-6989586621679091755"><span class="annot"><span class="annottext">Grapheme
</span><a href="#local-6989586621679091755"><span class="hs-identifier hs-var">g</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ShowS
forall a. Show a =&gt; a -&gt; [Char]
</span><a href="../../base/src/GHC.Show.html#show"><span class="hs-identifier hs-var">show</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Grapheme -&gt; Char
</span><a href="System.Console.Haskeline.LineState.html#gBaseChar"><span class="hs-identifier hs-var hs-var">gBaseChar</span></a></span><span> </span><span class="annot"><span class="annottext">Grapheme
</span><a href="#local-6989586621679091755"><span class="hs-identifier hs-var">g</span></a></span><span> </span><span class="annot"><span class="annottext">Char -&gt; ShowS
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">Grapheme -&gt; [Char]
</span><a href="System.Console.Haskeline.LineState.html#combiningChars"><span class="hs-identifier hs-var hs-var">combiningChars</span></a></span><span> </span><span class="annot"><span class="annottext">Grapheme
</span><a href="#local-6989586621679091755"><span class="hs-identifier hs-var">g</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-82"></span><span>
</span><span id="line-83"></span><span class="annot"><a href="System.Console.Haskeline.LineState.html#baseChar"><span class="hs-identifier hs-type">baseChar</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#Grapheme"><span class="hs-identifier hs-type">Grapheme</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Char</span></span><span>
</span><span id="line-84"></span><span id="baseChar"><span class="annot"><span class="annottext">baseChar :: Grapheme -&gt; Char
</span><a href="System.Console.Haskeline.LineState.html#baseChar"><span class="hs-identifier hs-var hs-var">baseChar</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Grapheme -&gt; Char
</span><a href="System.Console.Haskeline.LineState.html#gBaseChar"><span class="hs-identifier hs-var hs-var">gBaseChar</span></a></span><span>
</span><span id="line-85"></span><span>
</span><span id="line-86"></span><span class="annot"><a href="System.Console.Haskeline.LineState.html#modifyBaseChar"><span class="hs-identifier hs-type">modifyBaseChar</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier hs-type">Char</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Char</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#Grapheme"><span class="hs-identifier hs-type">Grapheme</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#Grapheme"><span class="hs-identifier hs-type">Grapheme</span></a></span><span>
</span><span id="line-87"></span><span id="modifyBaseChar"><span class="annot"><span class="annottext">modifyBaseChar :: (Char -&gt; Char) -&gt; Grapheme -&gt; Grapheme
</span><a href="System.Console.Haskeline.LineState.html#modifyBaseChar"><span class="hs-identifier hs-var hs-var">modifyBaseChar</span></a></span></span><span> </span><span id="local-6989586621679091754"><span class="annot"><span class="annottext">Char -&gt; Char
</span><a href="#local-6989586621679091754"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621679091753"><span class="annot"><span class="annottext">Grapheme
</span><a href="#local-6989586621679091753"><span class="hs-identifier hs-var">g</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Grapheme
</span><a href="#local-6989586621679091753"><span class="hs-identifier hs-var">g</span></a></span><span> </span><span class="hs-special">{</span><span class="annot"><span class="annottext">gBaseChar :: Char
</span><a href="System.Console.Haskeline.LineState.html#gBaseChar"><span class="hs-identifier hs-var">gBaseChar</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Char -&gt; Char
</span><a href="#local-6989586621679091754"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Grapheme -&gt; Char
</span><a href="System.Console.Haskeline.LineState.html#gBaseChar"><span class="hs-identifier hs-var hs-var">gBaseChar</span></a></span><span> </span><span class="annot"><span class="annottext">Grapheme
</span><a href="#local-6989586621679091753"><span class="hs-identifier hs-var">g</span></a></span><span class="hs-special">)</span><span class="hs-special">}</span><span>
</span><span id="line-88"></span><span>
</span><span id="line-89"></span><span class="annot"><a href="System.Console.Haskeline.LineState.html#mapBaseChars"><span class="hs-identifier hs-type">mapBaseChars</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier hs-type">Char</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Char</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="System.Console.Haskeline.LineState.html#Grapheme"><span class="hs-identifier hs-type">Grapheme</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="System.Console.Haskeline.LineState.html#Grapheme"><span class="hs-identifier hs-type">Grapheme</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-90"></span><span id="mapBaseChars"><span class="annot"><span class="annottext">mapBaseChars :: (Char -&gt; Char) -&gt; [Grapheme] -&gt; [Grapheme]
</span><a href="System.Console.Haskeline.LineState.html#mapBaseChars"><span class="hs-identifier hs-var hs-var">mapBaseChars</span></a></span></span><span> </span><span id="local-6989586621679091752"><span class="annot"><span class="annottext">Char -&gt; Char
</span><a href="#local-6989586621679091752"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Grapheme -&gt; Grapheme) -&gt; [Grapheme] -&gt; [Grapheme]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Char -&gt; Char) -&gt; Grapheme -&gt; Grapheme
</span><a href="System.Console.Haskeline.LineState.html#modifyBaseChar"><span class="hs-identifier hs-var">modifyBaseChar</span></a></span><span> </span><span class="annot"><span class="annottext">Char -&gt; Char
</span><a href="#local-6989586621679091752"><span class="hs-identifier hs-var">f</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-91"></span><span>
</span><span id="line-92"></span><span class="hs-comment">-- | Create a 'Grapheme' from a single base character.</span><span>
</span><span id="line-93"></span><span class="hs-comment">--</span><span>
</span><span id="line-94"></span><span class="hs-comment">-- NOTE: Careful, don't use outside this module; and inside, make sure this is only</span><span>
</span><span id="line-95"></span><span class="hs-comment">-- ever called on non-combining characters.</span><span>
</span><span id="line-96"></span><span class="annot"><a href="System.Console.Haskeline.LineState.html#baseGrapheme"><span class="hs-identifier hs-type">baseGrapheme</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Char</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#Grapheme"><span class="hs-identifier hs-type">Grapheme</span></a></span><span>
</span><span id="line-97"></span><span id="baseGrapheme"><span class="annot"><span class="annottext">baseGrapheme :: Char -&gt; Grapheme
</span><a href="System.Console.Haskeline.LineState.html#baseGrapheme"><span class="hs-identifier hs-var hs-var">baseGrapheme</span></a></span></span><span> </span><span id="local-6989586621679091750"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679091750"><span class="hs-identifier hs-var">c</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Grapheme :: Char -&gt; [Char] -&gt; Grapheme
</span><a href="System.Console.Haskeline.LineState.html#Grapheme"><span class="hs-identifier hs-type">Grapheme</span></a></span><span> </span><span class="hs-special">{</span><span class="annot"><span class="annottext">gBaseChar :: Char
</span><a href="System.Console.Haskeline.LineState.html#gBaseChar"><span class="hs-identifier hs-var">gBaseChar</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679091750"><span class="hs-identifier hs-var">c</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">combiningChars :: [Char]
</span><a href="System.Console.Haskeline.LineState.html#combiningChars"><span class="hs-identifier hs-var">combiningChars</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">}</span><span>
</span><span id="line-98"></span><span>
</span><span id="line-99"></span><span class="hs-comment">-- | Add a combining character to the given 'Grapheme'.</span><span>
</span><span id="line-100"></span><span class="annot"><a href="System.Console.Haskeline.LineState.html#addCombiner"><span class="hs-identifier hs-type">addCombiner</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#Grapheme"><span class="hs-identifier hs-type">Grapheme</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Char</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#Grapheme"><span class="hs-identifier hs-type">Grapheme</span></a></span><span>
</span><span id="line-101"></span><span id="addCombiner"><span class="annot"><span class="annottext">addCombiner :: Grapheme -&gt; Char -&gt; Grapheme
</span><a href="System.Console.Haskeline.LineState.html#addCombiner"><span class="hs-identifier hs-var hs-var">addCombiner</span></a></span></span><span> </span><span id="local-6989586621679091748"><span class="annot"><span class="annottext">Grapheme
</span><a href="#local-6989586621679091748"><span class="hs-identifier hs-var">g</span></a></span></span><span> </span><span id="local-6989586621679091747"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679091747"><span class="hs-identifier hs-var">c</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Grapheme
</span><a href="#local-6989586621679091748"><span class="hs-identifier hs-var">g</span></a></span><span> </span><span class="hs-special">{</span><span class="annot"><span class="annottext">combiningChars :: [Char]
</span><a href="System.Console.Haskeline.LineState.html#combiningChars"><span class="hs-identifier hs-var">combiningChars</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Grapheme -&gt; [Char]
</span><a href="System.Console.Haskeline.LineState.html#combiningChars"><span class="hs-identifier hs-var hs-var">combiningChars</span></a></span><span> </span><span class="annot"><span class="annottext">Grapheme
</span><a href="#local-6989586621679091748"><span class="hs-identifier hs-var">g</span></a></span><span> </span><span class="annot"><span class="annottext">[Char] -&gt; ShowS
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679091747"><span class="hs-identifier hs-var">c</span></a></span><span class="hs-special">]</span><span class="hs-special">}</span><span>
</span><span id="line-102"></span><span>
</span><span id="line-103"></span><span class="annot"><a href="System.Console.Haskeline.LineState.html#isCombiningChar"><span class="hs-identifier hs-type">isCombiningChar</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Char</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-104"></span><span id="isCombiningChar"><span class="annot"><span class="annottext">isCombiningChar :: Char -&gt; Bool
</span><a href="System.Console.Haskeline.LineState.html#isCombiningChar"><span class="hs-identifier hs-var hs-var">isCombiningChar</span></a></span></span><span> </span><span id="local-6989586621679091745"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679091745"><span class="hs-identifier hs-var">c</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Char -&gt; GeneralCategory
</span><a href="../../base/src/GHC.Unicode.html#generalCategory"><span class="hs-identifier hs-var">generalCategory</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679091745"><span class="hs-identifier hs-var">c</span></a></span><span> </span><span class="annot"><span class="annottext">GeneralCategory -&gt; GeneralCategory -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">GeneralCategory
</span><a href="../../base/src/GHC.Unicode.html#NonSpacingMark"><span class="hs-identifier hs-var">NonSpacingMark</span></a></span><span>
</span><span id="line-105"></span><span>
</span><span id="line-106"></span><span class="hs-comment">-- | Converts a string into a sequence of graphemes.</span><span>
</span><span id="line-107"></span><span class="hs-comment">--</span><span>
</span><span id="line-108"></span><span class="hs-comment">-- NOTE: Drops any initial, unattached combining characters.</span><span>
</span><span id="line-109"></span><span class="annot"><a href="System.Console.Haskeline.LineState.html#stringToGraphemes"><span class="hs-identifier hs-type">stringToGraphemes</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="System.Console.Haskeline.LineState.html#Grapheme"><span class="hs-identifier hs-type">Grapheme</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-110"></span><span id="stringToGraphemes"><span class="annot"><span class="annottext">stringToGraphemes :: [Char] -&gt; [Grapheme]
</span><a href="System.Console.Haskeline.LineState.html#stringToGraphemes"><span class="hs-identifier hs-var hs-var">stringToGraphemes</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Char] -&gt; [Grapheme]
</span><a href="#local-6989586621679091742"><span class="hs-identifier hs-var">mkString</span></a></span><span> </span><span class="annot"><span class="annottext">([Char] -&gt; [Grapheme]) -&gt; ShowS -&gt; [Char] -&gt; [Grapheme]
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">(Char -&gt; Bool) -&gt; ShowS
forall a. (a -&gt; Bool) -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.List.html#dropWhile"><span class="hs-identifier hs-var">dropWhile</span></a></span><span> </span><span class="annot"><span class="annottext">Char -&gt; Bool
</span><a href="System.Console.Haskeline.LineState.html#isCombiningChar"><span class="hs-identifier hs-var">isCombiningChar</span></a></span><span>
</span><span id="line-111"></span><span>    </span><span class="hs-keyword">where</span><span>
</span><span id="line-112"></span><span>        </span><span id="local-6989586621679091742"><span class="annot"><span class="annottext">mkString :: [Char] -&gt; [Grapheme]
</span><a href="#local-6989586621679091742"><span class="hs-identifier hs-var hs-var">mkString</span></a></span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-113"></span><span>        </span><span class="hs-comment">-- Minor hack: &quot;\ESC...\STX&quot; or &quot;\SOH\ESC...\STX&quot;, where &quot;\ESC...&quot; is some</span><span>
</span><span id="line-114"></span><span>        </span><span class="hs-comment">-- control sequence (e.g., ANSI colors), is represented as a grapheme</span><span>
</span><span id="line-115"></span><span>        </span><span class="hs-comment">-- of zero length with '\ESC' as the base character.</span><span>
</span><span id="line-116"></span><span>        </span><span class="hs-comment">-- Note that this won't round-trip correctly with graphemesToString.</span><span>
</span><span id="line-117"></span><span>        </span><span class="hs-comment">-- In practice, however, that's fine since control characters can only occur</span><span>
</span><span id="line-118"></span><span>        </span><span class="hs-comment">-- in the prompt.</span><span>
</span><span id="line-119"></span><span>        </span><span class="annot"><a href="#local-6989586621679091742"><span class="hs-identifier hs-var">mkString</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'\SOH'</span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span id="local-6989586621679091738"><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621679091738"><span class="hs-identifier hs-var">cs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Char] -&gt; [Grapheme]
</span><a href="System.Console.Haskeline.LineState.html#stringToGraphemes"><span class="hs-identifier hs-var">stringToGraphemes</span></a></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621679091738"><span class="hs-identifier hs-var">cs</span></a></span><span>
</span><span id="line-120"></span><span>        </span><span class="annot"><a href="#local-6989586621679091742"><span class="hs-identifier hs-var">mkString</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'\ESC'</span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span id="local-6989586621679091737"><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621679091737"><span class="hs-identifier hs-var">cs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">|</span><span> </span><span class="hs-special">(</span><span id="local-6989586621679091736"><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621679091736"><span class="hs-identifier hs-var">ctrl</span></a></span></span><span class="hs-special">,</span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'\STX'</span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span id="local-6989586621679091735"><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621679091735"><span class="hs-identifier hs-var">rest</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(Char -&gt; Bool) -&gt; [Char] -&gt; ([Char], [Char])
forall a. (a -&gt; Bool) -&gt; [a] -&gt; ([a], [a])
</span><a href="../../base/src/GHC.List.html#break"><span class="hs-identifier hs-var">break</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char -&gt; Char -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'\STX'</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621679091737"><span class="hs-identifier hs-var">cs</span></a></span><span>
</span><span id="line-121"></span><span>                    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Char -&gt; [Char] -&gt; Grapheme
</span><a href="System.Console.Haskeline.LineState.html#Grapheme"><span class="hs-identifier hs-var">Grapheme</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'\ESC'</span></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621679091736"><span class="hs-identifier hs-var">ctrl</span></a></span><span> </span><span class="annot"><span class="annottext">Grapheme -&gt; [Grapheme] -&gt; [Grapheme]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">[Char] -&gt; [Grapheme]
</span><a href="System.Console.Haskeline.LineState.html#stringToGraphemes"><span class="hs-identifier hs-var">stringToGraphemes</span></a></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621679091735"><span class="hs-identifier hs-var">rest</span></a></span><span>
</span><span id="line-122"></span><span>        </span><span class="annot"><a href="#local-6989586621679091742"><span class="hs-identifier hs-var">mkString</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679091733"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679091733"><span class="hs-identifier hs-var">c</span></a></span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span id="local-6989586621679091732"><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621679091732"><span class="hs-identifier hs-var">cs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Char -&gt; [Char] -&gt; Grapheme
</span><a href="System.Console.Haskeline.LineState.html#Grapheme"><span class="hs-identifier hs-var">Grapheme</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679091733"><span class="hs-identifier hs-var">c</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Char -&gt; Bool) -&gt; ShowS
forall a. (a -&gt; Bool) -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.List.html#takeWhile"><span class="hs-identifier hs-var">takeWhile</span></a></span><span> </span><span class="annot"><span class="annottext">Char -&gt; Bool
</span><a href="System.Console.Haskeline.LineState.html#isCombiningChar"><span class="hs-identifier hs-var">isCombiningChar</span></a></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621679091732"><span class="hs-identifier hs-var">cs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-123"></span><span>                                </span><span class="annot"><span class="annottext">Grapheme -&gt; [Grapheme] -&gt; [Grapheme]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">[Char] -&gt; [Grapheme]
</span><a href="#local-6989586621679091742"><span class="hs-identifier hs-var">mkString</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Char -&gt; Bool) -&gt; ShowS
forall a. (a -&gt; Bool) -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.List.html#dropWhile"><span class="hs-identifier hs-var">dropWhile</span></a></span><span> </span><span class="annot"><span class="annottext">Char -&gt; Bool
</span><a href="System.Console.Haskeline.LineState.html#isCombiningChar"><span class="hs-identifier hs-var">isCombiningChar</span></a></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621679091732"><span class="hs-identifier hs-var">cs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-124"></span><span>
</span><span id="line-125"></span><span class="annot"><a href="System.Console.Haskeline.LineState.html#graphemesToString"><span class="hs-identifier hs-type">graphemesToString</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="System.Console.Haskeline.LineState.html#Grapheme"><span class="hs-identifier hs-type">Grapheme</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span>
</span><span id="line-126"></span><span id="graphemesToString"><span class="annot"><span class="annottext">graphemesToString :: [Grapheme] -&gt; [Char]
</span><a href="System.Console.Haskeline.LineState.html#graphemesToString"><span class="hs-identifier hs-var hs-var">graphemesToString</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Grapheme -&gt; [Char]) -&gt; [Grapheme] -&gt; [Char]
forall (t :: * -&gt; *) a b. Foldable t =&gt; (a -&gt; [b]) -&gt; t a -&gt; [b]
</span><a href="../../base/src/Data.Foldable.html#concatMap"><span class="hs-identifier hs-var">concatMap</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621679091729"><span class="annot"><span class="annottext">Grapheme
</span><a href="#local-6989586621679091729"><span class="hs-identifier hs-var">g</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Grapheme -&gt; Char
</span><a href="System.Console.Haskeline.LineState.html#baseChar"><span class="hs-identifier hs-var">baseChar</span></a></span><span> </span><span class="annot"><span class="annottext">Grapheme
</span><a href="#local-6989586621679091729"><span class="hs-identifier hs-var">g</span></a></span><span> </span><span class="annot"><span class="annottext">Char -&gt; ShowS
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">Grapheme -&gt; [Char]
</span><a href="System.Console.Haskeline.LineState.html#combiningChars"><span class="hs-identifier hs-var hs-var">combiningChars</span></a></span><span> </span><span class="annot"><span class="annottext">Grapheme
</span><a href="#local-6989586621679091729"><span class="hs-identifier hs-var">g</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-127"></span><span>
</span><span id="line-128"></span><span class="hs-comment">-- | This class abstracts away the internal representations of the line state,</span><span>
</span><span id="line-129"></span><span class="hs-comment">-- for use by the drawing actions.  Line state is generally stored in a zipper format.</span><span>
</span><span id="line-130"></span><span class="hs-keyword">class</span><span> </span><span id="LineState"><span class="annot"><a href="System.Console.Haskeline.LineState.html#LineState"><span class="hs-identifier hs-var">LineState</span></a></span></span><span> </span><span id="local-6989586621679091894"><span class="annot"><a href="#local-6989586621679091894"><span class="hs-identifier hs-type">s</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-131"></span><span>    </span><span id="beforeCursor"><span class="annot"><a href="System.Console.Haskeline.LineState.html#beforeCursor"><span class="hs-identifier hs-type">beforeCursor</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#Prefix"><span class="hs-identifier hs-type">Prefix</span></a></span><span> </span><span class="hs-comment">-- ^ The input prefix.</span><span>
</span><span id="line-132"></span><span>                    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679091894"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="hs-comment">-- ^ The current line state.</span><span>
</span><span id="line-133"></span><span>                    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="System.Console.Haskeline.LineState.html#Grapheme"><span class="hs-identifier hs-type">Grapheme</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-comment">-- ^ The text to the left of the cursor</span><span>
</span><span id="line-134"></span><span>                                  </span><span class="hs-comment">-- (including the prefix).</span><span>
</span><span id="line-135"></span><span>    </span><span id="afterCursor"><span class="annot"><a href="System.Console.Haskeline.LineState.html#afterCursor"><span class="hs-identifier hs-type">afterCursor</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="#local-6989586621679091894"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="System.Console.Haskeline.LineState.html#Grapheme"><span class="hs-identifier hs-type">Grapheme</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-comment">-- ^ The text under and to the right of the cursor.</span><span>
</span><span id="line-136"></span><span>
</span><span id="line-137"></span><span class="hs-keyword">type</span><span> </span><span id="Prefix"><span class="annot"><a href="System.Console.Haskeline.LineState.html#Prefix"><span class="hs-identifier hs-var">Prefix</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="System.Console.Haskeline.LineState.html#Grapheme"><span class="hs-identifier hs-type">Grapheme</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-138"></span><span>
</span><span id="line-139"></span><span class="hs-comment">-- | The characters in the line (with the cursor in the middle).  NOT in a zippered format;</span><span>
</span><span id="line-140"></span><span class="hs-comment">-- both lists are in the order left-&gt;right that appears on the screen.</span><span>
</span><span id="line-141"></span><span class="hs-keyword">type</span><span> </span><span id="LineChars"><span class="annot"><a href="System.Console.Haskeline.LineState.html#LineChars"><span class="hs-identifier hs-var">LineChars</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="annot"><a href="System.Console.Haskeline.LineState.html#Grapheme"><span class="hs-identifier hs-type">Grapheme</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span class="hs-special">[</span><span class="annot"><a href="System.Console.Haskeline.LineState.html#Grapheme"><span class="hs-identifier hs-type">Grapheme</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-142"></span><span>
</span><span id="line-143"></span><span class="hs-comment">-- | Accessor function for the various backends.</span><span>
</span><span id="line-144"></span><span id="local-6989586621679091898"><span class="annot"><a href="System.Console.Haskeline.LineState.html#lineChars"><span class="hs-identifier hs-type">lineChars</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#LineState"><span class="hs-identifier hs-type">LineState</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679091898"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#Prefix"><span class="hs-identifier hs-type">Prefix</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679091898"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#LineChars"><span class="hs-identifier hs-type">LineChars</span></a></span></span><span>
</span><span id="line-145"></span><span id="lineChars"><span class="annot"><span class="annottext">lineChars :: forall s. LineState s =&gt; [Grapheme] -&gt; s -&gt; LineChars
</span><a href="System.Console.Haskeline.LineState.html#lineChars"><span class="hs-identifier hs-var hs-var">lineChars</span></a></span></span><span> </span><span id="local-6989586621679091723"><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091723"><span class="hs-identifier hs-var">prefix</span></a></span></span><span> </span><span id="local-6989586621679091722"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679091722"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Grapheme] -&gt; s -&gt; [Grapheme]
forall s. LineState s =&gt; [Grapheme] -&gt; s -&gt; [Grapheme]
</span><a href="System.Console.Haskeline.LineState.html#beforeCursor"><span class="hs-identifier hs-var">beforeCursor</span></a></span><span> </span><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091723"><span class="hs-identifier hs-var">prefix</span></a></span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679091722"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">s -&gt; [Grapheme]
forall s. LineState s =&gt; s -&gt; [Grapheme]
</span><a href="System.Console.Haskeline.LineState.html#afterCursor"><span class="hs-identifier hs-var">afterCursor</span></a></span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679091722"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-146"></span><span>
</span><span id="line-147"></span><span class="hs-comment">-- | Compute the number of characters under and to the right of the cursor.</span><span>
</span><span id="line-148"></span><span class="annot"><a href="System.Console.Haskeline.LineState.html#lengthToEnd"><span class="hs-identifier hs-type">lengthToEnd</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#LineChars"><span class="hs-identifier hs-type">LineChars</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span>
</span><span id="line-149"></span><span id="lengthToEnd"><span class="annot"><span class="annottext">lengthToEnd :: LineChars -&gt; Int
</span><a href="System.Console.Haskeline.LineState.html#lengthToEnd"><span class="hs-identifier hs-var hs-var">lengthToEnd</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Grapheme] -&gt; Int
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Int
</span><a href="../../base/src/Data.Foldable.html#length"><span class="hs-identifier hs-var">length</span></a></span><span> </span><span class="annot"><span class="annottext">([Grapheme] -&gt; Int)
-&gt; (LineChars -&gt; [Grapheme]) -&gt; LineChars -&gt; Int
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">LineChars -&gt; [Grapheme]
forall a b. (a, b) -&gt; b
</span><a href="../../base/src/Data.Tuple.html#snd"><span class="hs-identifier hs-var">snd</span></a></span><span>
</span><span id="line-150"></span><span>
</span><span id="line-151"></span><span class="hs-keyword">class</span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#LineState"><span class="hs-identifier hs-type">LineState</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679091889"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span id="Result"><span class="annot"><a href="System.Console.Haskeline.LineState.html#Result"><span class="hs-identifier hs-var">Result</span></a></span></span><span> </span><span id="local-6989586621679091889"><span class="annot"><a href="#local-6989586621679091889"><span class="hs-identifier hs-type">s</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-152"></span><span>    </span><span id="toResult"><span class="annot"><a href="System.Console.Haskeline.LineState.html#toResult"><span class="hs-identifier hs-type">toResult</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="#local-6989586621679091889"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span>
</span><span id="line-153"></span><span>
</span><span id="line-154"></span><span class="hs-keyword">class</span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#LineState"><span class="hs-identifier hs-type">LineState</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679091887"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span id="Save"><span class="annot"><a href="System.Console.Haskeline.LineState.html#Save"><span class="hs-identifier hs-var">Save</span></a></span></span><span> </span><span id="local-6989586621679091887"><span class="annot"><a href="#local-6989586621679091887"><span class="hs-identifier hs-type">s</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-155"></span><span>    </span><span id="save"><span class="annot"><a href="System.Console.Haskeline.LineState.html#save"><span class="hs-identifier hs-type">save</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="#local-6989586621679091887"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#InsertMode"><span class="hs-identifier hs-type">InsertMode</span></a></span><span>
</span><span id="line-156"></span><span>    </span><span id="restore"><span class="annot"><a href="System.Console.Haskeline.LineState.html#restore"><span class="hs-identifier hs-type">restore</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#InsertMode"><span class="hs-identifier hs-type">InsertMode</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679091887"><span class="hs-identifier hs-type">s</span></a></span><span>
</span><span id="line-157"></span><span>
</span><span id="line-158"></span><span id="local-6989586621679091885"><span class="annot"><a href="System.Console.Haskeline.LineState.html#listSave"><span class="hs-identifier hs-type">listSave</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#Save"><span class="hs-identifier hs-type">Save</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679091885"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679091885"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="System.Console.Haskeline.LineState.html#Grapheme"><span class="hs-identifier hs-type">Grapheme</span></a></span><span class="hs-special">]</span></span><span>
</span><span id="line-159"></span><span id="listSave"><span class="annot"><span class="annottext">listSave :: forall s. Save s =&gt; s -&gt; [Grapheme]
</span><a href="System.Console.Haskeline.LineState.html#listSave"><span class="hs-identifier hs-var hs-var">listSave</span></a></span></span><span> </span><span id="local-6989586621679091713"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679091713"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">s -&gt; InsertMode
forall s. Save s =&gt; s -&gt; InsertMode
</span><a href="System.Console.Haskeline.LineState.html#save"><span class="hs-identifier hs-var">save</span></a></span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679091713"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="hs-keyword">of</span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#IMode"><span class="hs-identifier hs-type">IMode</span></a></span><span> </span><span id="local-6989586621679091711"><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091711"><span class="hs-identifier hs-var">xs</span></a></span></span><span> </span><span id="local-6989586621679091710"><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091710"><span class="hs-identifier hs-var">ys</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">[Grapheme] -&gt; [Grapheme]
forall a. [a] -&gt; [a]
</span><a href="../../base/src/GHC.List.html#reverse"><span class="hs-identifier hs-var">reverse</span></a></span><span> </span><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091711"><span class="hs-identifier hs-var">xs</span></a></span><span> </span><span class="annot"><span class="annottext">[Grapheme] -&gt; [Grapheme] -&gt; [Grapheme]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091710"><span class="hs-identifier hs-var">ys</span></a></span><span>
</span><span id="line-160"></span><span>
</span><span id="line-161"></span><span id="local-6989586621679091882"><span class="annot"><a href="System.Console.Haskeline.LineState.html#listRestore"><span class="hs-identifier hs-type">listRestore</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#Save"><span class="hs-identifier hs-type">Save</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679091882"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="System.Console.Haskeline.LineState.html#Grapheme"><span class="hs-identifier hs-type">Grapheme</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679091882"><span class="hs-identifier hs-type">s</span></a></span></span><span>
</span><span id="line-162"></span><span id="listRestore"><span class="annot"><span class="annottext">listRestore :: forall s. Save s =&gt; [Grapheme] -&gt; s
</span><a href="System.Console.Haskeline.LineState.html#listRestore"><span class="hs-identifier hs-var hs-var">listRestore</span></a></span></span><span> </span><span id="local-6989586621679091706"><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091706"><span class="hs-identifier hs-var">xs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">InsertMode -&gt; s
forall s. Save s =&gt; InsertMode -&gt; s
</span><a href="System.Console.Haskeline.LineState.html#restore"><span class="hs-identifier hs-var">restore</span></a></span><span> </span><span class="annot"><span class="annottext">(InsertMode -&gt; s) -&gt; InsertMode -&gt; s
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">[Grapheme] -&gt; [Grapheme] -&gt; InsertMode
</span><a href="System.Console.Haskeline.LineState.html#IMode"><span class="hs-identifier hs-var">IMode</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Grapheme] -&gt; [Grapheme]
forall a. [a] -&gt; [a]
</span><a href="../../base/src/GHC.List.html#reverse"><span class="hs-identifier hs-var">reverse</span></a></span><span> </span><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091706"><span class="hs-identifier hs-var">xs</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-163"></span><span>
</span><span id="line-164"></span><span class="hs-keyword">class</span><span> </span><span id="Move"><span class="annot"><a href="System.Console.Haskeline.LineState.html#Move"><span class="hs-identifier hs-var">Move</span></a></span></span><span> </span><span id="local-6989586621679091876"><span class="annot"><a href="#local-6989586621679091876"><span class="hs-identifier hs-type">s</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-165"></span><span>    </span><span id="goLeft"><span class="annot"><a href="System.Console.Haskeline.LineState.html#goLeft"><span class="hs-identifier hs-type">goLeft</span></a></span></span><span class="hs-special">,</span><span> </span><span id="goRight"><span class="annot"><a href="System.Console.Haskeline.LineState.html#goRight"><span class="hs-identifier hs-type">goRight</span></a></span></span><span class="hs-special">,</span><span> </span><span id="moveToStart"><span class="annot"><a href="System.Console.Haskeline.LineState.html#moveToStart"><span class="hs-identifier hs-type">moveToStart</span></a></span></span><span class="hs-special">,</span><span> </span><span id="moveToEnd"><span class="annot"><a href="System.Console.Haskeline.LineState.html#moveToEnd"><span class="hs-identifier hs-type">moveToEnd</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="#local-6989586621679091876"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679091876"><span class="hs-identifier hs-type">s</span></a></span><span>
</span><span id="line-166"></span><span>    </span><span>
</span><span id="line-167"></span><span class="hs-comment">-- | The standard line state representation; considers the cursor to be located</span><span>
</span><span id="line-168"></span><span class="hs-comment">-- between two characters.  The first list is reversed.</span><span>
</span><span id="line-169"></span><span class="hs-keyword">data</span><span> </span><span id="InsertMode"><span class="annot"><a href="System.Console.Haskeline.LineState.html#InsertMode"><span class="hs-identifier hs-var">InsertMode</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="IMode"><span class="annot"><a href="System.Console.Haskeline.LineState.html#IMode"><span class="hs-identifier hs-var">IMode</span></a></span></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="System.Console.Haskeline.LineState.html#Grapheme"><span class="hs-identifier hs-type">Grapheme</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="System.Console.Haskeline.LineState.html#Grapheme"><span class="hs-identifier hs-type">Grapheme</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-170"></span><span>                    </span><span class="hs-keyword">deriving</span><span> </span><span class="hs-special">(</span><span id="local-6989586621679091691"><span id="local-6989586621679091693"><span id="local-6989586621679091700"><span class="annot"><span class="annottext">Int -&gt; InsertMode -&gt; ShowS
[InsertMode] -&gt; ShowS
InsertMode -&gt; [Char]
(Int -&gt; InsertMode -&gt; ShowS)
-&gt; (InsertMode -&gt; [Char])
-&gt; ([InsertMode] -&gt; ShowS)
-&gt; Show InsertMode
forall a.
(Int -&gt; a -&gt; ShowS) -&gt; (a -&gt; [Char]) -&gt; ([a] -&gt; ShowS) -&gt; Show a
showList :: [InsertMode] -&gt; ShowS
$cshowList :: [InsertMode] -&gt; ShowS
show :: InsertMode -&gt; [Char]
$cshow :: InsertMode -&gt; [Char]
showsPrec :: Int -&gt; InsertMode -&gt; ShowS
$cshowsPrec :: Int -&gt; InsertMode -&gt; ShowS
</span><a href="../../base/src/GHC.Show.html#Show"><span class="hs-identifier hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var">Show</span></a></span></span></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679091684"><span id="local-6989586621679091689"><span class="annot"><span class="annottext">InsertMode -&gt; InsertMode -&gt; Bool
(InsertMode -&gt; InsertMode -&gt; Bool)
-&gt; (InsertMode -&gt; InsertMode -&gt; Bool) -&gt; Eq InsertMode
forall a. (a -&gt; a -&gt; Bool) -&gt; (a -&gt; a -&gt; Bool) -&gt; Eq a
/= :: InsertMode -&gt; InsertMode -&gt; Bool
$c/= :: InsertMode -&gt; InsertMode -&gt; Bool
== :: InsertMode -&gt; InsertMode -&gt; Bool
$c== :: InsertMode -&gt; InsertMode -&gt; Bool
</span><span class="hs-identifier hs-var hs-var hs-var hs-var hs-var hs-var">Eq</span></span></span></span><span class="hs-special">)</span><span>
</span><span id="line-171"></span><span>
</span><span id="line-172"></span><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#LineState"><span class="hs-identifier hs-type">LineState</span></a></span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#InsertMode"><span class="hs-identifier hs-type">InsertMode</span></a></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-173"></span><span>    </span><span id="local-6989586621679091679"><span class="annot"><span class="annottext">beforeCursor :: [Grapheme] -&gt; InsertMode -&gt; [Grapheme]
</span><a href="#local-6989586621679091679"><span class="hs-identifier hs-var hs-var hs-var hs-var">beforeCursor</span></a></span></span><span> </span><span id="local-6989586621679091678"><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091678"><span class="hs-identifier hs-var">prefix</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="System.Console.Haskeline.LineState.html#IMode"><span class="hs-identifier hs-type">IMode</span></a></span><span> </span><span id="local-6989586621679091677"><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091677"><span class="hs-identifier hs-var">xs</span></a></span></span><span> </span><span class="annot"><span class="annottext">[Grapheme]
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091678"><span class="hs-identifier hs-var">prefix</span></a></span><span> </span><span class="annot"><span class="annottext">[Grapheme] -&gt; [Grapheme] -&gt; [Grapheme]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">[Grapheme] -&gt; [Grapheme]
forall a. [a] -&gt; [a]
</span><a href="../../base/src/GHC.List.html#reverse"><span class="hs-identifier hs-var">reverse</span></a></span><span> </span><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091677"><span class="hs-identifier hs-var">xs</span></a></span><span>
</span><span id="line-174"></span><span>    </span><span id="local-6989586621679091676"><span class="annot"><span class="annottext">afterCursor :: InsertMode -&gt; [Grapheme]
</span><a href="#local-6989586621679091676"><span class="hs-identifier hs-var hs-var hs-var hs-var">afterCursor</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="System.Console.Haskeline.LineState.html#IMode"><span class="hs-identifier hs-type">IMode</span></a></span><span> </span><span class="annot"><span class="annottext">[Grapheme]
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621679091675"><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091675"><span class="hs-identifier hs-var">ys</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091675"><span class="hs-identifier hs-var">ys</span></a></span><span>
</span><span id="line-175"></span><span>
</span><span id="line-176"></span><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#Result"><span class="hs-identifier hs-type">Result</span></a></span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#InsertMode"><span class="hs-identifier hs-type">InsertMode</span></a></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-177"></span><span>    </span><span id="local-6989586621679091669"><span class="annot"><span class="annottext">toResult :: InsertMode -&gt; [Char]
</span><a href="#local-6989586621679091669"><span class="hs-identifier hs-var hs-var hs-var hs-var">toResult</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="System.Console.Haskeline.LineState.html#IMode"><span class="hs-identifier hs-type">IMode</span></a></span><span> </span><span id="local-6989586621679091668"><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091668"><span class="hs-identifier hs-var">xs</span></a></span></span><span> </span><span id="local-6989586621679091667"><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091667"><span class="hs-identifier hs-var">ys</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Grapheme] -&gt; [Char]
</span><a href="System.Console.Haskeline.LineState.html#graphemesToString"><span class="hs-identifier hs-var">graphemesToString</span></a></span><span> </span><span class="annot"><span class="annottext">([Grapheme] -&gt; [Char]) -&gt; [Grapheme] -&gt; [Char]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">[Grapheme] -&gt; [Grapheme]
forall a. [a] -&gt; [a]
</span><a href="../../base/src/GHC.List.html#reverse"><span class="hs-identifier hs-var">reverse</span></a></span><span> </span><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091668"><span class="hs-identifier hs-var">xs</span></a></span><span> </span><span class="annot"><span class="annottext">[Grapheme] -&gt; [Grapheme] -&gt; [Grapheme]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091667"><span class="hs-identifier hs-var">ys</span></a></span><span>
</span><span id="line-178"></span><span>
</span><span id="line-179"></span><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#Save"><span class="hs-identifier hs-type">Save</span></a></span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#InsertMode"><span class="hs-identifier hs-type">InsertMode</span></a></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-180"></span><span>    </span><span id="local-6989586621679091660"><span class="annot"><span class="annottext">save :: InsertMode -&gt; InsertMode
</span><a href="#local-6989586621679091660"><span class="hs-identifier hs-var hs-var hs-var hs-var">save</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">InsertMode -&gt; InsertMode
forall a. a -&gt; a
</span><a href="../../base/src/GHC.Base.html#id"><span class="hs-identifier hs-var">id</span></a></span><span>
</span><span id="line-181"></span><span>    </span><span id="local-6989586621679091658"><span class="annot"><span class="annottext">restore :: InsertMode -&gt; InsertMode
</span><a href="#local-6989586621679091658"><span class="hs-identifier hs-var hs-var hs-var hs-var">restore</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">InsertMode -&gt; InsertMode
forall a. a -&gt; a
</span><a href="../../base/src/GHC.Base.html#id"><span class="hs-identifier hs-var">id</span></a></span><span>
</span><span id="line-182"></span><span>
</span><span id="line-183"></span><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#Move"><span class="hs-identifier hs-type">Move</span></a></span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#InsertMode"><span class="hs-identifier hs-type">InsertMode</span></a></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-184"></span><span>    </span><span id="local-6989586621679091652"><span class="annot"><span class="annottext">goLeft :: InsertMode -&gt; InsertMode
</span><a href="#local-6989586621679091652"><span class="hs-identifier hs-var hs-var hs-var hs-var">goLeft</span></a></span></span><span> </span><span id="local-6989586621679091651"><span class="annot"><span class="annottext">im :: InsertMode
</span><a href="#local-6989586621679091651"><span class="hs-identifier hs-var">im</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="System.Console.Haskeline.LineState.html#IMode"><span class="hs-identifier hs-type">IMode</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">[Grapheme]
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">InsertMode
</span><a href="#local-6989586621679091651"><span class="hs-identifier hs-var">im</span></a></span><span> </span><span>
</span><span id="line-185"></span><span>    </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#goLeft"><span class="hs-identifier hs-var">goLeft</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="System.Console.Haskeline.LineState.html#IMode"><span class="hs-identifier hs-type">IMode</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679091650"><span class="annot"><span class="annottext">Grapheme
</span><a href="#local-6989586621679091650"><span class="hs-identifier hs-var">x</span></a></span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span id="local-6989586621679091649"><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091649"><span class="hs-identifier hs-var">xs</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679091648"><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091648"><span class="hs-identifier hs-var">ys</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Grapheme] -&gt; [Grapheme] -&gt; InsertMode
</span><a href="System.Console.Haskeline.LineState.html#IMode"><span class="hs-identifier hs-var">IMode</span></a></span><span> </span><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091649"><span class="hs-identifier hs-var">xs</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Grapheme
</span><a href="#local-6989586621679091650"><span class="hs-identifier hs-var">x</span></a></span><span class="annot"><span class="annottext">Grapheme -&gt; [Grapheme] -&gt; [Grapheme]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091648"><span class="hs-identifier hs-var">ys</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-186"></span><span>
</span><span id="line-187"></span><span>    </span><span id="local-6989586621679091647"><span class="annot"><span class="annottext">goRight :: InsertMode -&gt; InsertMode
</span><a href="#local-6989586621679091647"><span class="hs-identifier hs-var hs-var hs-var hs-var">goRight</span></a></span></span><span> </span><span id="local-6989586621679091646"><span class="annot"><span class="annottext">im :: InsertMode
</span><a href="#local-6989586621679091646"><span class="hs-identifier hs-var">im</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="System.Console.Haskeline.LineState.html#IMode"><span class="hs-identifier hs-type">IMode</span></a></span><span> </span><span class="annot"><span class="annottext">[Grapheme]
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">InsertMode
</span><a href="#local-6989586621679091646"><span class="hs-identifier hs-var">im</span></a></span><span>
</span><span id="line-188"></span><span>    </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#goRight"><span class="hs-identifier hs-var">goRight</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="System.Console.Haskeline.LineState.html#IMode"><span class="hs-identifier hs-type">IMode</span></a></span><span> </span><span id="local-6989586621679091645"><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091645"><span class="hs-identifier hs-var">ys</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679091644"><span class="annot"><span class="annottext">Grapheme
</span><a href="#local-6989586621679091644"><span class="hs-identifier hs-var">x</span></a></span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span id="local-6989586621679091643"><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091643"><span class="hs-identifier hs-var">xs</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Grapheme] -&gt; [Grapheme] -&gt; InsertMode
</span><a href="System.Console.Haskeline.LineState.html#IMode"><span class="hs-identifier hs-var">IMode</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Grapheme
</span><a href="#local-6989586621679091644"><span class="hs-identifier hs-var">x</span></a></span><span class="annot"><span class="annottext">Grapheme -&gt; [Grapheme] -&gt; [Grapheme]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091645"><span class="hs-identifier hs-var">ys</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091643"><span class="hs-identifier hs-var">xs</span></a></span><span>
</span><span id="line-189"></span><span>
</span><span id="line-190"></span><span>    </span><span id="local-6989586621679091642"><span class="annot"><span class="annottext">moveToStart :: InsertMode -&gt; InsertMode
</span><a href="#local-6989586621679091642"><span class="hs-identifier hs-var hs-var hs-var hs-var">moveToStart</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="System.Console.Haskeline.LineState.html#IMode"><span class="hs-identifier hs-type">IMode</span></a></span><span> </span><span id="local-6989586621679091641"><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091641"><span class="hs-identifier hs-var">xs</span></a></span></span><span> </span><span id="local-6989586621679091640"><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091640"><span class="hs-identifier hs-var">ys</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Grapheme] -&gt; [Grapheme] -&gt; InsertMode
</span><a href="System.Console.Haskeline.LineState.html#IMode"><span class="hs-identifier hs-var">IMode</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Grapheme] -&gt; [Grapheme]
forall a. [a] -&gt; [a]
</span><a href="../../base/src/GHC.List.html#reverse"><span class="hs-identifier hs-var">reverse</span></a></span><span> </span><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091641"><span class="hs-identifier hs-var">xs</span></a></span><span> </span><span class="annot"><span class="annottext">[Grapheme] -&gt; [Grapheme] -&gt; [Grapheme]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091640"><span class="hs-identifier hs-var">ys</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-191"></span><span>    </span><span id="local-6989586621679091639"><span class="annot"><span class="annottext">moveToEnd :: InsertMode -&gt; InsertMode
</span><a href="#local-6989586621679091639"><span class="hs-identifier hs-var hs-var hs-var hs-var">moveToEnd</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="System.Console.Haskeline.LineState.html#IMode"><span class="hs-identifier hs-type">IMode</span></a></span><span> </span><span id="local-6989586621679091638"><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091638"><span class="hs-identifier hs-var">xs</span></a></span></span><span> </span><span id="local-6989586621679091637"><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091637"><span class="hs-identifier hs-var">ys</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Grapheme] -&gt; [Grapheme] -&gt; InsertMode
</span><a href="System.Console.Haskeline.LineState.html#IMode"><span class="hs-identifier hs-var">IMode</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Grapheme] -&gt; [Grapheme]
forall a. [a] -&gt; [a]
</span><a href="../../base/src/GHC.List.html#reverse"><span class="hs-identifier hs-var">reverse</span></a></span><span> </span><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091637"><span class="hs-identifier hs-var">ys</span></a></span><span> </span><span class="annot"><span class="annottext">[Grapheme] -&gt; [Grapheme] -&gt; [Grapheme]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091638"><span class="hs-identifier hs-var">xs</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-192"></span><span>
</span><span id="line-193"></span><span class="annot"><a href="System.Console.Haskeline.LineState.html#emptyIM"><span class="hs-identifier hs-type">emptyIM</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#InsertMode"><span class="hs-identifier hs-type">InsertMode</span></a></span><span>
</span><span id="line-194"></span><span id="emptyIM"><span class="annot"><span class="annottext">emptyIM :: InsertMode
</span><a href="System.Console.Haskeline.LineState.html#emptyIM"><span class="hs-identifier hs-var hs-var">emptyIM</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Grapheme] -&gt; [Grapheme] -&gt; InsertMode
</span><a href="System.Console.Haskeline.LineState.html#IMode"><span class="hs-identifier hs-var">IMode</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-195"></span><span>
</span><span id="line-196"></span><span class="hs-comment">-- | Insert one character, which may be combining, to the left of the cursor.</span><span>
</span><span id="line-197"></span><span class="hs-comment">--  </span><span>
</span><span id="line-198"></span><span class="annot"><a href="System.Console.Haskeline.LineState.html#insertChar"><span class="hs-identifier hs-type">insertChar</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Char</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#InsertMode"><span class="hs-identifier hs-type">InsertMode</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#InsertMode"><span class="hs-identifier hs-type">InsertMode</span></a></span><span>
</span><span id="line-199"></span><span id="insertChar"><span class="annot"><span class="annottext">insertChar :: Char -&gt; InsertMode -&gt; InsertMode
</span><a href="System.Console.Haskeline.LineState.html#insertChar"><span class="hs-identifier hs-var hs-var">insertChar</span></a></span></span><span> </span><span id="local-6989586621679091636"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679091636"><span class="hs-identifier hs-var">c</span></a></span></span><span> </span><span id="local-6989586621679091635"><span class="annot"><span class="annottext">im :: InsertMode
</span><a href="#local-6989586621679091635"><span class="hs-identifier hs-var">im</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="System.Console.Haskeline.LineState.html#IMode"><span class="hs-identifier hs-type">IMode</span></a></span><span> </span><span id="local-6989586621679091634"><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091634"><span class="hs-identifier hs-var">xs</span></a></span></span><span> </span><span id="local-6989586621679091633"><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091633"><span class="hs-identifier hs-var">ys</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-200"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Char -&gt; Bool
</span><a href="System.Console.Haskeline.LineState.html#isCombiningChar"><span class="hs-identifier hs-var">isCombiningChar</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679091636"><span class="hs-identifier hs-var">c</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091634"><span class="hs-identifier hs-var">xs</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-201"></span><span>                            </span><span class="hs-special">[</span><span class="hs-special">]</span><span>   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">InsertMode
</span><a href="#local-6989586621679091635"><span class="hs-identifier hs-var">im</span></a></span><span> </span><span class="hs-comment">-- drop a combining character if it</span><span>
</span><span id="line-202"></span><span>                                       </span><span class="hs-comment">-- appears at the start of the line.</span><span>
</span><span id="line-203"></span><span>                            </span><span id="local-6989586621679091632"><span class="annot"><span class="annottext">Grapheme
</span><a href="#local-6989586621679091632"><span class="hs-identifier hs-var">z</span></a></span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span id="local-6989586621679091631"><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091631"><span class="hs-identifier hs-var">zs</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">[Grapheme] -&gt; [Grapheme] -&gt; InsertMode
</span><a href="System.Console.Haskeline.LineState.html#IMode"><span class="hs-identifier hs-var">IMode</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Grapheme -&gt; Char -&gt; Grapheme
</span><a href="System.Console.Haskeline.LineState.html#addCombiner"><span class="hs-identifier hs-var">addCombiner</span></a></span><span> </span><span class="annot"><span class="annottext">Grapheme
</span><a href="#local-6989586621679091632"><span class="hs-identifier hs-var">z</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679091636"><span class="hs-identifier hs-var">c</span></a></span><span> </span><span class="annot"><span class="annottext">Grapheme -&gt; [Grapheme] -&gt; [Grapheme]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091631"><span class="hs-identifier hs-var">zs</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091633"><span class="hs-identifier hs-var">ys</span></a></span><span>
</span><span id="line-204"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>         </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Grapheme] -&gt; [Grapheme] -&gt; InsertMode
</span><a href="System.Console.Haskeline.LineState.html#IMode"><span class="hs-identifier hs-var">IMode</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char -&gt; Grapheme
</span><a href="System.Console.Haskeline.LineState.html#baseGrapheme"><span class="hs-identifier hs-var">baseGrapheme</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679091636"><span class="hs-identifier hs-var">c</span></a></span><span> </span><span class="annot"><span class="annottext">Grapheme -&gt; [Grapheme] -&gt; [Grapheme]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091634"><span class="hs-identifier hs-var">xs</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091633"><span class="hs-identifier hs-var">ys</span></a></span><span>
</span><span id="line-205"></span><span>
</span><span id="line-206"></span><span class="hs-comment">-- | Insert a sequence of characters to the left of the cursor. </span><span>
</span><span id="line-207"></span><span class="annot"><a href="System.Console.Haskeline.LineState.html#insertString"><span class="hs-identifier hs-type">insertString</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#InsertMode"><span class="hs-identifier hs-type">InsertMode</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#InsertMode"><span class="hs-identifier hs-type">InsertMode</span></a></span><span>
</span><span id="line-208"></span><span id="insertString"><span class="annot"><span class="annottext">insertString :: [Char] -&gt; InsertMode -&gt; InsertMode
</span><a href="System.Console.Haskeline.LineState.html#insertString"><span class="hs-identifier hs-var hs-var">insertString</span></a></span></span><span> </span><span id="local-6989586621679091630"><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621679091630"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="System.Console.Haskeline.LineState.html#IMode"><span class="hs-identifier hs-type">IMode</span></a></span><span> </span><span id="local-6989586621679091629"><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091629"><span class="hs-identifier hs-var">xs</span></a></span></span><span> </span><span id="local-6989586621679091628"><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091628"><span class="hs-identifier hs-var">ys</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Grapheme] -&gt; [Grapheme] -&gt; InsertMode
</span><a href="System.Console.Haskeline.LineState.html#IMode"><span class="hs-identifier hs-var">IMode</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Grapheme] -&gt; [Grapheme]
forall a. [a] -&gt; [a]
</span><a href="../../base/src/GHC.List.html#reverse"><span class="hs-identifier hs-var">reverse</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Char] -&gt; [Grapheme]
</span><a href="System.Console.Haskeline.LineState.html#stringToGraphemes"><span class="hs-identifier hs-var">stringToGraphemes</span></a></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621679091630"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Grapheme] -&gt; [Grapheme] -&gt; [Grapheme]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091629"><span class="hs-identifier hs-var">xs</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091628"><span class="hs-identifier hs-var">ys</span></a></span><span>
</span><span id="line-209"></span><span>
</span><span id="line-210"></span><span class="annot"><a href="System.Console.Haskeline.LineState.html#deleteNext"><span class="hs-identifier hs-type">deleteNext</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#deletePrev"><span class="hs-identifier hs-type">deletePrev</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#InsertMode"><span class="hs-identifier hs-type">InsertMode</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#InsertMode"><span class="hs-identifier hs-type">InsertMode</span></a></span><span>
</span><span id="line-211"></span><span id="deleteNext"><span class="annot"><span class="annottext">deleteNext :: InsertMode -&gt; InsertMode
</span><a href="System.Console.Haskeline.LineState.html#deleteNext"><span class="hs-identifier hs-var hs-var">deleteNext</span></a></span></span><span> </span><span id="local-6989586621679091627"><span class="annot"><span class="annottext">im :: InsertMode
</span><a href="#local-6989586621679091627"><span class="hs-identifier hs-var">im</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="System.Console.Haskeline.LineState.html#IMode"><span class="hs-identifier hs-type">IMode</span></a></span><span> </span><span class="annot"><span class="annottext">[Grapheme]
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">InsertMode
</span><a href="#local-6989586621679091627"><span class="hs-identifier hs-var">im</span></a></span><span>
</span><span id="line-212"></span><span class="annot"><a href="System.Console.Haskeline.LineState.html#deleteNext"><span class="hs-identifier hs-var">deleteNext</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="System.Console.Haskeline.LineState.html#IMode"><span class="hs-identifier hs-type">IMode</span></a></span><span> </span><span id="local-6989586621679091626"><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091626"><span class="hs-identifier hs-var">xs</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Grapheme
</span><span class="hs-identifier">_</span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span id="local-6989586621679091625"><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091625"><span class="hs-identifier hs-var">ys</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Grapheme] -&gt; [Grapheme] -&gt; InsertMode
</span><a href="System.Console.Haskeline.LineState.html#IMode"><span class="hs-identifier hs-var">IMode</span></a></span><span> </span><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091626"><span class="hs-identifier hs-var">xs</span></a></span><span> </span><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091625"><span class="hs-identifier hs-var">ys</span></a></span><span>
</span><span id="line-213"></span><span>
</span><span id="line-214"></span><span id="deletePrev"><span class="annot"><span class="annottext">deletePrev :: InsertMode -&gt; InsertMode
</span><a href="System.Console.Haskeline.LineState.html#deletePrev"><span class="hs-identifier hs-var hs-var">deletePrev</span></a></span></span><span> </span><span id="local-6989586621679091624"><span class="annot"><span class="annottext">im :: InsertMode
</span><a href="#local-6989586621679091624"><span class="hs-identifier hs-var">im</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="System.Console.Haskeline.LineState.html#IMode"><span class="hs-identifier hs-type">IMode</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">[Grapheme]
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">InsertMode
</span><a href="#local-6989586621679091624"><span class="hs-identifier hs-var">im</span></a></span><span>
</span><span id="line-215"></span><span class="annot"><a href="System.Console.Haskeline.LineState.html#deletePrev"><span class="hs-identifier hs-var">deletePrev</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="System.Console.Haskeline.LineState.html#IMode"><span class="hs-identifier hs-type">IMode</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Grapheme
</span><span class="hs-identifier">_</span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span id="local-6989586621679091623"><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091623"><span class="hs-identifier hs-var">xs</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679091622"><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091622"><span class="hs-identifier hs-var">ys</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Grapheme] -&gt; [Grapheme] -&gt; InsertMode
</span><a href="System.Console.Haskeline.LineState.html#IMode"><span class="hs-identifier hs-var">IMode</span></a></span><span> </span><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091623"><span class="hs-identifier hs-var">xs</span></a></span><span> </span><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091622"><span class="hs-identifier hs-var">ys</span></a></span><span> </span><span>
</span><span id="line-216"></span><span>
</span><span id="line-217"></span><span class="annot"><a href="System.Console.Haskeline.LineState.html#skipLeft"><span class="hs-identifier hs-type">skipLeft</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#skipRight"><span class="hs-identifier hs-type">skipRight</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier hs-type">Char</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#InsertMode"><span class="hs-identifier hs-type">InsertMode</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#InsertMode"><span class="hs-identifier hs-type">InsertMode</span></a></span><span>
</span><span id="line-218"></span><span id="skipLeft"><span class="annot"><span class="annottext">skipLeft :: (Char -&gt; Bool) -&gt; InsertMode -&gt; InsertMode
</span><a href="System.Console.Haskeline.LineState.html#skipLeft"><span class="hs-identifier hs-var hs-var">skipLeft</span></a></span></span><span> </span><span id="local-6989586621679091621"><span class="annot"><span class="annottext">Char -&gt; Bool
</span><a href="#local-6989586621679091621"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="System.Console.Haskeline.LineState.html#IMode"><span class="hs-identifier hs-type">IMode</span></a></span><span> </span><span id="local-6989586621679091620"><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091620"><span class="hs-identifier hs-var">xs</span></a></span></span><span> </span><span id="local-6989586621679091619"><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091619"><span class="hs-identifier hs-var">ys</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">let</span><span> </span><span class="hs-special">(</span><span id="local-6989586621679091618"><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091618"><span class="hs-identifier hs-var">ws</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679091617"><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091617"><span class="hs-identifier hs-var">zs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Grapheme -&gt; Bool) -&gt; [Grapheme] -&gt; LineChars
forall a. (a -&gt; Bool) -&gt; [a] -&gt; ([a], [a])
</span><a href="../../base/src/GHC.List.html#span"><span class="hs-identifier hs-var">span</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char -&gt; Bool
</span><a href="#local-6989586621679091621"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">(Char -&gt; Bool) -&gt; (Grapheme -&gt; Char) -&gt; Grapheme -&gt; Bool
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Grapheme -&gt; Char
</span><a href="System.Console.Haskeline.LineState.html#baseChar"><span class="hs-identifier hs-var">baseChar</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091620"><span class="hs-identifier hs-var">xs</span></a></span><span> </span><span>
</span><span id="line-219"></span><span>                           </span><span class="hs-keyword">in</span><span> </span><span class="annot"><span class="annottext">[Grapheme] -&gt; [Grapheme] -&gt; InsertMode
</span><a href="System.Console.Haskeline.LineState.html#IMode"><span class="hs-identifier hs-var">IMode</span></a></span><span> </span><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091617"><span class="hs-identifier hs-var">zs</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Grapheme] -&gt; [Grapheme]
forall a. [a] -&gt; [a]
</span><a href="../../base/src/GHC.List.html#reverse"><span class="hs-identifier hs-var">reverse</span></a></span><span> </span><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091618"><span class="hs-identifier hs-var">ws</span></a></span><span> </span><span class="annot"><span class="annottext">[Grapheme] -&gt; [Grapheme] -&gt; [Grapheme]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091619"><span class="hs-identifier hs-var">ys</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-220"></span><span id="skipRight"><span class="annot"><span class="annottext">skipRight :: (Char -&gt; Bool) -&gt; InsertMode -&gt; InsertMode
</span><a href="System.Console.Haskeline.LineState.html#skipRight"><span class="hs-identifier hs-var hs-var">skipRight</span></a></span></span><span> </span><span id="local-6989586621679091615"><span class="annot"><span class="annottext">Char -&gt; Bool
</span><a href="#local-6989586621679091615"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="System.Console.Haskeline.LineState.html#IMode"><span class="hs-identifier hs-type">IMode</span></a></span><span> </span><span id="local-6989586621679091614"><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091614"><span class="hs-identifier hs-var">xs</span></a></span></span><span> </span><span id="local-6989586621679091613"><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091613"><span class="hs-identifier hs-var">ys</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">let</span><span> </span><span class="hs-special">(</span><span id="local-6989586621679091612"><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091612"><span class="hs-identifier hs-var">ws</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679091611"><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091611"><span class="hs-identifier hs-var">zs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Grapheme -&gt; Bool) -&gt; [Grapheme] -&gt; LineChars
forall a. (a -&gt; Bool) -&gt; [a] -&gt; ([a], [a])
</span><a href="../../base/src/GHC.List.html#span"><span class="hs-identifier hs-var">span</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char -&gt; Bool
</span><a href="#local-6989586621679091615"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">(Char -&gt; Bool) -&gt; (Grapheme -&gt; Char) -&gt; Grapheme -&gt; Bool
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Grapheme -&gt; Char
</span><a href="System.Console.Haskeline.LineState.html#baseChar"><span class="hs-identifier hs-var">baseChar</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091613"><span class="hs-identifier hs-var">ys</span></a></span><span> </span><span>
</span><span id="line-221"></span><span>                            </span><span class="hs-keyword">in</span><span> </span><span class="annot"><span class="annottext">[Grapheme] -&gt; [Grapheme] -&gt; InsertMode
</span><a href="System.Console.Haskeline.LineState.html#IMode"><span class="hs-identifier hs-var">IMode</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Grapheme] -&gt; [Grapheme]
forall a. [a] -&gt; [a]
</span><a href="../../base/src/GHC.List.html#reverse"><span class="hs-identifier hs-var">reverse</span></a></span><span> </span><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091612"><span class="hs-identifier hs-var">ws</span></a></span><span> </span><span class="annot"><span class="annottext">[Grapheme] -&gt; [Grapheme] -&gt; [Grapheme]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091614"><span class="hs-identifier hs-var">xs</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091611"><span class="hs-identifier hs-var">zs</span></a></span><span>
</span><span id="line-222"></span><span>
</span><span id="line-223"></span><span class="annot"><a href="System.Console.Haskeline.LineState.html#transposeChars"><span class="hs-identifier hs-type">transposeChars</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#InsertMode"><span class="hs-identifier hs-type">InsertMode</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#InsertMode"><span class="hs-identifier hs-type">InsertMode</span></a></span><span>
</span><span id="line-224"></span><span id="transposeChars"><span class="annot"><span class="annottext">transposeChars :: InsertMode -&gt; InsertMode
</span><a href="System.Console.Haskeline.LineState.html#transposeChars"><span class="hs-identifier hs-var hs-var">transposeChars</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="System.Console.Haskeline.LineState.html#IMode"><span class="hs-identifier hs-type">IMode</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679091610"><span class="annot"><span class="annottext">Grapheme
</span><a href="#local-6989586621679091610"><span class="hs-identifier hs-var">x</span></a></span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span id="local-6989586621679091609"><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091609"><span class="hs-identifier hs-var">xs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span id="local-6989586621679091608"><span class="annot"><span class="annottext">Grapheme
</span><a href="#local-6989586621679091608"><span class="hs-identifier hs-var">y</span></a></span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span id="local-6989586621679091607"><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091607"><span class="hs-identifier hs-var">ys</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Grapheme] -&gt; [Grapheme] -&gt; InsertMode
</span><a href="System.Console.Haskeline.LineState.html#IMode"><span class="hs-identifier hs-var">IMode</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Grapheme
</span><a href="#local-6989586621679091610"><span class="hs-identifier hs-var">x</span></a></span><span class="annot"><span class="annottext">Grapheme -&gt; [Grapheme] -&gt; [Grapheme]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span class="annot"><span class="annottext">Grapheme
</span><a href="#local-6989586621679091608"><span class="hs-identifier hs-var">y</span></a></span><span class="annot"><span class="annottext">Grapheme -&gt; [Grapheme] -&gt; [Grapheme]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091609"><span class="hs-identifier hs-var">xs</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091607"><span class="hs-identifier hs-var">ys</span></a></span><span>
</span><span id="line-225"></span><span class="annot"><a href="System.Console.Haskeline.LineState.html#transposeChars"><span class="hs-identifier hs-var">transposeChars</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="System.Console.Haskeline.LineState.html#IMode"><span class="hs-identifier hs-type">IMode</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679091606"><span class="annot"><span class="annottext">Grapheme
</span><a href="#local-6989586621679091606"><span class="hs-identifier hs-var">y</span></a></span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span id="local-6989586621679091605"><span class="annot"><span class="annottext">Grapheme
</span><a href="#local-6989586621679091605"><span class="hs-identifier hs-var">x</span></a></span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span id="local-6989586621679091604"><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091604"><span class="hs-identifier hs-var">xs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Grapheme] -&gt; [Grapheme] -&gt; InsertMode
</span><a href="System.Console.Haskeline.LineState.html#IMode"><span class="hs-identifier hs-var">IMode</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Grapheme
</span><a href="#local-6989586621679091605"><span class="hs-identifier hs-var">x</span></a></span><span class="annot"><span class="annottext">Grapheme -&gt; [Grapheme] -&gt; [Grapheme]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span class="annot"><span class="annottext">Grapheme
</span><a href="#local-6989586621679091606"><span class="hs-identifier hs-var">y</span></a></span><span class="annot"><span class="annottext">Grapheme -&gt; [Grapheme] -&gt; [Grapheme]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091604"><span class="hs-identifier hs-var">xs</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-226"></span><span class="annot"><a href="System.Console.Haskeline.LineState.html#transposeChars"><span class="hs-identifier hs-var">transposeChars</span></a></span><span> </span><span id="local-6989586621679091603"><span class="annot"><span class="annottext">InsertMode
</span><a href="#local-6989586621679091603"><span class="hs-identifier hs-var">im</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">InsertMode
</span><a href="#local-6989586621679091603"><span class="hs-identifier hs-var">im</span></a></span><span>
</span><span id="line-227"></span><span>
</span><span id="line-228"></span><span class="annot"><a href="System.Console.Haskeline.LineState.html#insertGraphemes"><span class="hs-identifier hs-type">insertGraphemes</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="System.Console.Haskeline.LineState.html#Grapheme"><span class="hs-identifier hs-type">Grapheme</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#InsertMode"><span class="hs-identifier hs-type">InsertMode</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#InsertMode"><span class="hs-identifier hs-type">InsertMode</span></a></span><span>
</span><span id="line-229"></span><span id="insertGraphemes"><span class="annot"><span class="annottext">insertGraphemes :: [Grapheme] -&gt; InsertMode -&gt; InsertMode
</span><a href="System.Console.Haskeline.LineState.html#insertGraphemes"><span class="hs-identifier hs-var hs-var">insertGraphemes</span></a></span></span><span> </span><span id="local-6989586621679091602"><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091602"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="System.Console.Haskeline.LineState.html#IMode"><span class="hs-identifier hs-type">IMode</span></a></span><span> </span><span id="local-6989586621679091601"><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091601"><span class="hs-identifier hs-var">xs</span></a></span></span><span> </span><span id="local-6989586621679091600"><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091600"><span class="hs-identifier hs-var">ys</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Grapheme] -&gt; [Grapheme] -&gt; InsertMode
</span><a href="System.Console.Haskeline.LineState.html#IMode"><span class="hs-identifier hs-var">IMode</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Grapheme] -&gt; [Grapheme]
forall a. [a] -&gt; [a]
</span><a href="../../base/src/GHC.List.html#reverse"><span class="hs-identifier hs-var">reverse</span></a></span><span> </span><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091602"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="annot"><span class="annottext">[Grapheme] -&gt; [Grapheme] -&gt; [Grapheme]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091601"><span class="hs-identifier hs-var">xs</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091600"><span class="hs-identifier hs-var">ys</span></a></span><span>
</span><span id="line-230"></span><span>
</span><span id="line-231"></span><span class="hs-comment">-- For the 'R' command.</span><span>
</span><span id="line-232"></span><span class="annot"><a href="System.Console.Haskeline.LineState.html#replaceCharIM"><span class="hs-identifier hs-type">replaceCharIM</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Char</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#InsertMode"><span class="hs-identifier hs-type">InsertMode</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#InsertMode"><span class="hs-identifier hs-type">InsertMode</span></a></span><span>
</span><span id="line-233"></span><span id="replaceCharIM"><span class="annot"><span class="annottext">replaceCharIM :: Char -&gt; InsertMode -&gt; InsertMode
</span><a href="System.Console.Haskeline.LineState.html#replaceCharIM"><span class="hs-identifier hs-var hs-var">replaceCharIM</span></a></span></span><span> </span><span id="local-6989586621679091599"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679091599"><span class="hs-identifier hs-var">c</span></a></span></span><span> </span><span id="local-6989586621679091598"><span class="annot"><span class="annottext">InsertMode
</span><a href="#local-6989586621679091598"><span class="hs-identifier hs-var">im</span></a></span></span><span>
</span><span id="line-234"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Char -&gt; Bool
</span><a href="System.Console.Haskeline.LineState.html#isCombiningChar"><span class="hs-identifier hs-var">isCombiningChar</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679091599"><span class="hs-identifier hs-var">c</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">InsertMode
</span><a href="#local-6989586621679091598"><span class="hs-identifier hs-var">im</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-235"></span><span>                    </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#IMode"><span class="hs-identifier hs-type">IMode</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">InsertMode
</span><a href="#local-6989586621679091598"><span class="hs-identifier hs-var">im</span></a></span><span>
</span><span id="line-236"></span><span>                    </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#IMode"><span class="hs-identifier hs-type">IMode</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-special">(</span><span id="local-6989586621679091597"><span class="annot"><span class="annottext">Grapheme
</span><a href="#local-6989586621679091597"><span class="hs-identifier hs-var">y</span></a></span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span id="local-6989586621679091596"><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091596"><span class="hs-identifier hs-var">ys</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">[Grapheme] -&gt; [Grapheme] -&gt; InsertMode
</span><a href="System.Console.Haskeline.LineState.html#IMode"><span class="hs-identifier hs-var">IMode</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Grapheme -&gt; Char -&gt; Grapheme
</span><a href="System.Console.Haskeline.LineState.html#addCombiner"><span class="hs-identifier hs-var">addCombiner</span></a></span><span> </span><span class="annot"><span class="annottext">Grapheme
</span><a href="#local-6989586621679091597"><span class="hs-identifier hs-var">y</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679091599"><span class="hs-identifier hs-var">c</span></a></span><span class="annot"><span class="annottext">Grapheme -&gt; [Grapheme] -&gt; [Grapheme]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091596"><span class="hs-identifier hs-var">ys</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-237"></span><span>                    </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#IMode"><span class="hs-identifier hs-type">IMode</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679091595"><span class="annot"><span class="annottext">Grapheme
</span><a href="#local-6989586621679091595"><span class="hs-identifier hs-var">x</span></a></span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span id="local-6989586621679091594"><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091594"><span class="hs-identifier hs-var">xs</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679091593"><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091593"><span class="hs-identifier hs-var">ys</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">[Grapheme] -&gt; [Grapheme] -&gt; InsertMode
</span><a href="System.Console.Haskeline.LineState.html#IMode"><span class="hs-identifier hs-var">IMode</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Grapheme -&gt; Char -&gt; Grapheme
</span><a href="System.Console.Haskeline.LineState.html#addCombiner"><span class="hs-identifier hs-var">addCombiner</span></a></span><span> </span><span class="annot"><span class="annottext">Grapheme
</span><a href="#local-6989586621679091595"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679091599"><span class="hs-identifier hs-var">c</span></a></span><span class="annot"><span class="annottext">Grapheme -&gt; [Grapheme] -&gt; [Grapheme]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091594"><span class="hs-identifier hs-var">xs</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091593"><span class="hs-identifier hs-var">ys</span></a></span><span>
</span><span id="line-238"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621679091592"><span class="annot"><span class="annottext">g :: Grapheme
</span><a href="#local-6989586621679091592"><span class="hs-identifier hs-var hs-var">g</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Char -&gt; Grapheme
</span><a href="System.Console.Haskeline.LineState.html#baseGrapheme"><span class="hs-identifier hs-var">baseGrapheme</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679091599"><span class="hs-identifier hs-var">c</span></a></span><span>
</span><span id="line-239"></span><span>                  </span><span class="hs-keyword">in</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">InsertMode
</span><a href="#local-6989586621679091598"><span class="hs-identifier hs-var">im</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-240"></span><span>                    </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#IMode"><span class="hs-identifier hs-type">IMode</span></a></span><span> </span><span id="local-6989586621679091591"><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091591"><span class="hs-identifier hs-var">xs</span></a></span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">[Grapheme] -&gt; [Grapheme] -&gt; InsertMode
</span><a href="System.Console.Haskeline.LineState.html#IMode"><span class="hs-identifier hs-var">IMode</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Grapheme
</span><a href="#local-6989586621679091592"><span class="hs-identifier hs-var">g</span></a></span><span class="annot"><span class="annottext">Grapheme -&gt; [Grapheme] -&gt; [Grapheme]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091591"><span class="hs-identifier hs-var">xs</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-241"></span><span>                    </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#IMode"><span class="hs-identifier hs-type">IMode</span></a></span><span> </span><span id="local-6989586621679091590"><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091590"><span class="hs-identifier hs-var">xs</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Grapheme
</span><span class="hs-identifier">_</span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span id="local-6989586621679091589"><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091589"><span class="hs-identifier hs-var">ys</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">[Grapheme] -&gt; [Grapheme] -&gt; InsertMode
</span><a href="System.Console.Haskeline.LineState.html#IMode"><span class="hs-identifier hs-var">IMode</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Grapheme
</span><a href="#local-6989586621679091592"><span class="hs-identifier hs-var">g</span></a></span><span class="annot"><span class="annottext">Grapheme -&gt; [Grapheme] -&gt; [Grapheme]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091590"><span class="hs-identifier hs-var">xs</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091589"><span class="hs-identifier hs-var">ys</span></a></span><span>
</span><span id="line-242"></span><span>
</span><span id="line-243"></span><span>
</span><span id="line-244"></span><span class="hs-comment">-- | Used by vi mode.  Considers the cursor to be located over some specific character.</span><span>
</span><span id="line-245"></span><span class="hs-comment">-- The first list is reversed.</span><span>
</span><span id="line-246"></span><span class="hs-keyword">data</span><span> </span><span id="CommandMode"><span class="annot"><a href="System.Console.Haskeline.LineState.html#CommandMode"><span class="hs-identifier hs-var">CommandMode</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="CMode"><span class="annot"><a href="System.Console.Haskeline.LineState.html#CMode"><span class="hs-identifier hs-var">CMode</span></a></span></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="System.Console.Haskeline.LineState.html#Grapheme"><span class="hs-identifier hs-type">Grapheme</span></a></span><span class="hs-special">]</span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#Grapheme"><span class="hs-identifier hs-type">Grapheme</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="System.Console.Haskeline.LineState.html#Grapheme"><span class="hs-identifier hs-type">Grapheme</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">|</span><span> </span><span id="CEmpty"><span class="annot"><a href="System.Console.Haskeline.LineState.html#CEmpty"><span class="hs-identifier hs-var">CEmpty</span></a></span></span><span>
</span><span id="line-247"></span><span>                    </span><span class="hs-keyword">deriving</span><span> </span><span id="local-6989586621679091576"><span id="local-6989586621679091578"><span id="local-6989586621679091585"><span class="annot"><span class="annottext">Int -&gt; CommandMode -&gt; ShowS
[CommandMode] -&gt; ShowS
CommandMode -&gt; [Char]
(Int -&gt; CommandMode -&gt; ShowS)
-&gt; (CommandMode -&gt; [Char])
-&gt; ([CommandMode] -&gt; ShowS)
-&gt; Show CommandMode
forall a.
(Int -&gt; a -&gt; ShowS) -&gt; (a -&gt; [Char]) -&gt; ([a] -&gt; ShowS) -&gt; Show a
showList :: [CommandMode] -&gt; ShowS
$cshowList :: [CommandMode] -&gt; ShowS
show :: CommandMode -&gt; [Char]
$cshow :: CommandMode -&gt; [Char]
showsPrec :: Int -&gt; CommandMode -&gt; ShowS
$cshowsPrec :: Int -&gt; CommandMode -&gt; ShowS
</span><a href="../../base/src/GHC.Show.html#Show"><span class="hs-identifier hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var">Show</span></a></span></span></span></span><span>
</span><span id="line-248"></span><span>
</span><span id="line-249"></span><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#LineState"><span class="hs-identifier hs-type">LineState</span></a></span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#CommandMode"><span class="hs-identifier hs-type">CommandMode</span></a></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-250"></span><span>    </span><span id="local-6989586621679091572"><span class="annot"><span class="annottext">beforeCursor :: [Grapheme] -&gt; CommandMode -&gt; [Grapheme]
</span><a href="#local-6989586621679091572"><span class="hs-identifier hs-var hs-var hs-var hs-var">beforeCursor</span></a></span></span><span> </span><span id="local-6989586621679091571"><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091571"><span class="hs-identifier hs-var">prefix</span></a></span></span><span> </span><span class="annot"><span class="annottext">CommandMode
</span><a href="System.Console.Haskeline.LineState.html#CEmpty"><span class="hs-identifier hs-var">CEmpty</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091571"><span class="hs-identifier hs-var">prefix</span></a></span><span>
</span><span id="line-251"></span><span>    </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#beforeCursor"><span class="hs-identifier hs-var">beforeCursor</span></a></span><span> </span><span id="local-6989586621679091570"><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091570"><span class="hs-identifier hs-var">prefix</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="System.Console.Haskeline.LineState.html#CMode"><span class="hs-identifier hs-type">CMode</span></a></span><span> </span><span id="local-6989586621679091569"><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091569"><span class="hs-identifier hs-var">xs</span></a></span></span><span> </span><span class="annot"><span class="annottext">Grapheme
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">[Grapheme]
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091570"><span class="hs-identifier hs-var">prefix</span></a></span><span> </span><span class="annot"><span class="annottext">[Grapheme] -&gt; [Grapheme] -&gt; [Grapheme]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">[Grapheme] -&gt; [Grapheme]
forall a. [a] -&gt; [a]
</span><a href="../../base/src/GHC.List.html#reverse"><span class="hs-identifier hs-var">reverse</span></a></span><span> </span><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091569"><span class="hs-identifier hs-var">xs</span></a></span><span>
</span><span id="line-252"></span><span>    </span><span id="local-6989586621679091568"><span class="annot"><span class="annottext">afterCursor :: CommandMode -&gt; [Grapheme]
</span><a href="#local-6989586621679091568"><span class="hs-identifier hs-var hs-var hs-var hs-var">afterCursor</span></a></span></span><span> </span><span class="annot"><span class="annottext">CommandMode
</span><a href="System.Console.Haskeline.LineState.html#CEmpty"><span class="hs-identifier hs-var">CEmpty</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-253"></span><span>    </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#afterCursor"><span class="hs-identifier hs-var">afterCursor</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="System.Console.Haskeline.LineState.html#CMode"><span class="hs-identifier hs-type">CMode</span></a></span><span> </span><span class="annot"><span class="annottext">[Grapheme]
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621679091567"><span class="annot"><span class="annottext">Grapheme
</span><a href="#local-6989586621679091567"><span class="hs-identifier hs-var">c</span></a></span></span><span> </span><span id="local-6989586621679091566"><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091566"><span class="hs-identifier hs-var">ys</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Grapheme
</span><a href="#local-6989586621679091567"><span class="hs-identifier hs-var">c</span></a></span><span class="annot"><span class="annottext">Grapheme -&gt; [Grapheme] -&gt; [Grapheme]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091566"><span class="hs-identifier hs-var">ys</span></a></span><span>
</span><span id="line-254"></span><span>
</span><span id="line-255"></span><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#Result"><span class="hs-identifier hs-type">Result</span></a></span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#CommandMode"><span class="hs-identifier hs-type">CommandMode</span></a></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-256"></span><span>    </span><span id="local-6989586621679091561"><span class="annot"><span class="annottext">toResult :: CommandMode -&gt; [Char]
</span><a href="#local-6989586621679091561"><span class="hs-identifier hs-var hs-var hs-var hs-var">toResult</span></a></span></span><span> </span><span class="annot"><span class="annottext">CommandMode
</span><a href="System.Console.Haskeline.LineState.html#CEmpty"><span class="hs-identifier hs-var">CEmpty</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-string">&quot;&quot;</span></span><span>
</span><span id="line-257"></span><span>    </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#toResult"><span class="hs-identifier hs-var">toResult</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="System.Console.Haskeline.LineState.html#CMode"><span class="hs-identifier hs-type">CMode</span></a></span><span> </span><span id="local-6989586621679091560"><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091560"><span class="hs-identifier hs-var">xs</span></a></span></span><span> </span><span id="local-6989586621679091559"><span class="annot"><span class="annottext">Grapheme
</span><a href="#local-6989586621679091559"><span class="hs-identifier hs-var">c</span></a></span></span><span> </span><span id="local-6989586621679091558"><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091558"><span class="hs-identifier hs-var">ys</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Grapheme] -&gt; [Char]
</span><a href="System.Console.Haskeline.LineState.html#graphemesToString"><span class="hs-identifier hs-var">graphemesToString</span></a></span><span> </span><span class="annot"><span class="annottext">([Grapheme] -&gt; [Char]) -&gt; [Grapheme] -&gt; [Char]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">[Grapheme] -&gt; [Grapheme]
forall a. [a] -&gt; [a]
</span><a href="../../base/src/GHC.List.html#reverse"><span class="hs-identifier hs-var">reverse</span></a></span><span> </span><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091560"><span class="hs-identifier hs-var">xs</span></a></span><span> </span><span class="annot"><span class="annottext">[Grapheme] -&gt; [Grapheme] -&gt; [Grapheme]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Grapheme
</span><a href="#local-6989586621679091559"><span class="hs-identifier hs-var">c</span></a></span><span class="annot"><span class="annottext">Grapheme -&gt; [Grapheme] -&gt; [Grapheme]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091558"><span class="hs-identifier hs-var">ys</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-258"></span><span>
</span><span id="line-259"></span><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#Save"><span class="hs-identifier hs-type">Save</span></a></span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#CommandMode"><span class="hs-identifier hs-type">CommandMode</span></a></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-260"></span><span>    </span><span id="local-6989586621679091552"><span class="annot"><span class="annottext">save :: CommandMode -&gt; InsertMode
</span><a href="#local-6989586621679091552"><span class="hs-identifier hs-var hs-var hs-var hs-var">save</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CommandMode -&gt; InsertMode
</span><a href="System.Console.Haskeline.LineState.html#insertFromCommandMode"><span class="hs-identifier hs-var">insertFromCommandMode</span></a></span><span>
</span><span id="line-261"></span><span>    </span><span id="local-6989586621679091551"><span class="annot"><span class="annottext">restore :: InsertMode -&gt; CommandMode
</span><a href="#local-6989586621679091551"><span class="hs-identifier hs-var hs-var hs-var hs-var">restore</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">InsertMode -&gt; CommandMode
</span><a href="System.Console.Haskeline.LineState.html#enterCommandModeRight"><span class="hs-identifier hs-var">enterCommandModeRight</span></a></span><span>
</span><span id="line-262"></span><span>
</span><span id="line-263"></span><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#Move"><span class="hs-identifier hs-type">Move</span></a></span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#CommandMode"><span class="hs-identifier hs-type">CommandMode</span></a></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-264"></span><span>    </span><span id="local-6989586621679091545"><span class="annot"><span class="annottext">goLeft :: CommandMode -&gt; CommandMode
</span><a href="#local-6989586621679091545"><span class="hs-identifier hs-var hs-var hs-var hs-var">goLeft</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="System.Console.Haskeline.LineState.html#CMode"><span class="hs-identifier hs-type">CMode</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679091544"><span class="annot"><span class="annottext">Grapheme
</span><a href="#local-6989586621679091544"><span class="hs-identifier hs-var">x</span></a></span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span id="local-6989586621679091543"><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091543"><span class="hs-identifier hs-var">xs</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679091542"><span class="annot"><span class="annottext">Grapheme
</span><a href="#local-6989586621679091542"><span class="hs-identifier hs-var">c</span></a></span></span><span> </span><span id="local-6989586621679091541"><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091541"><span class="hs-identifier hs-var">ys</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Grapheme] -&gt; Grapheme -&gt; [Grapheme] -&gt; CommandMode
</span><a href="System.Console.Haskeline.LineState.html#CMode"><span class="hs-identifier hs-var">CMode</span></a></span><span> </span><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091543"><span class="hs-identifier hs-var">xs</span></a></span><span> </span><span class="annot"><span class="annottext">Grapheme
</span><a href="#local-6989586621679091544"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Grapheme
</span><a href="#local-6989586621679091542"><span class="hs-identifier hs-var">c</span></a></span><span class="annot"><span class="annottext">Grapheme -&gt; [Grapheme] -&gt; [Grapheme]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091541"><span class="hs-identifier hs-var">ys</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-265"></span><span>    </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#goLeft"><span class="hs-identifier hs-var">goLeft</span></a></span><span> </span><span id="local-6989586621679091540"><span class="annot"><span class="annottext">CommandMode
</span><a href="#local-6989586621679091540"><span class="hs-identifier hs-var">cm</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CommandMode
</span><a href="#local-6989586621679091540"><span class="hs-identifier hs-var">cm</span></a></span><span>
</span><span id="line-266"></span><span>
</span><span id="line-267"></span><span>    </span><span id="local-6989586621679091539"><span class="annot"><span class="annottext">goRight :: CommandMode -&gt; CommandMode
</span><a href="#local-6989586621679091539"><span class="hs-identifier hs-var hs-var hs-var hs-var">goRight</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="System.Console.Haskeline.LineState.html#CMode"><span class="hs-identifier hs-type">CMode</span></a></span><span> </span><span id="local-6989586621679091538"><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091538"><span class="hs-identifier hs-var">xs</span></a></span></span><span> </span><span id="local-6989586621679091537"><span class="annot"><span class="annottext">Grapheme
</span><a href="#local-6989586621679091537"><span class="hs-identifier hs-var">c</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679091536"><span class="annot"><span class="annottext">Grapheme
</span><a href="#local-6989586621679091536"><span class="hs-identifier hs-var">y</span></a></span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span id="local-6989586621679091535"><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091535"><span class="hs-identifier hs-var">ys</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Grapheme] -&gt; Grapheme -&gt; [Grapheme] -&gt; CommandMode
</span><a href="System.Console.Haskeline.LineState.html#CMode"><span class="hs-identifier hs-var">CMode</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Grapheme
</span><a href="#local-6989586621679091537"><span class="hs-identifier hs-var">c</span></a></span><span class="annot"><span class="annottext">Grapheme -&gt; [Grapheme] -&gt; [Grapheme]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091538"><span class="hs-identifier hs-var">xs</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Grapheme
</span><a href="#local-6989586621679091536"><span class="hs-identifier hs-var">y</span></a></span><span> </span><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091535"><span class="hs-identifier hs-var">ys</span></a></span><span>
</span><span id="line-268"></span><span>    </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#goRight"><span class="hs-identifier hs-var">goRight</span></a></span><span> </span><span id="local-6989586621679091534"><span class="annot"><span class="annottext">CommandMode
</span><a href="#local-6989586621679091534"><span class="hs-identifier hs-var">cm</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CommandMode
</span><a href="#local-6989586621679091534"><span class="hs-identifier hs-var">cm</span></a></span><span>
</span><span id="line-269"></span><span>
</span><span id="line-270"></span><span>    </span><span id="local-6989586621679091533"><span class="annot"><span class="annottext">moveToStart :: CommandMode -&gt; CommandMode
</span><a href="#local-6989586621679091533"><span class="hs-identifier hs-var hs-var hs-var hs-var">moveToStart</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="System.Console.Haskeline.LineState.html#CMode"><span class="hs-identifier hs-type">CMode</span></a></span><span> </span><span id="local-6989586621679091532"><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091532"><span class="hs-identifier hs-var">xs</span></a></span></span><span> </span><span id="local-6989586621679091531"><span class="annot"><span class="annottext">Grapheme
</span><a href="#local-6989586621679091531"><span class="hs-identifier hs-var">c</span></a></span></span><span> </span><span id="local-6989586621679091530"><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091530"><span class="hs-identifier hs-var">ys</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621679091529"><span class="annot"><span class="annottext">zs :: [Grapheme]
</span><a href="#local-6989586621679091529"><span class="hs-identifier hs-var hs-var">zs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Grapheme] -&gt; [Grapheme]
forall a. [a] -&gt; [a]
</span><a href="../../base/src/GHC.List.html#reverse"><span class="hs-identifier hs-var">reverse</span></a></span><span> </span><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091532"><span class="hs-identifier hs-var">xs</span></a></span><span> </span><span class="annot"><span class="annottext">[Grapheme] -&gt; [Grapheme] -&gt; [Grapheme]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Grapheme
</span><a href="#local-6989586621679091531"><span class="hs-identifier hs-var">c</span></a></span><span class="annot"><span class="annottext">Grapheme -&gt; [Grapheme] -&gt; [Grapheme]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091530"><span class="hs-identifier hs-var">ys</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">in</span><span> </span><span class="annot"><span class="annottext">[Grapheme] -&gt; Grapheme -&gt; [Grapheme] -&gt; CommandMode
</span><a href="System.Console.Haskeline.LineState.html#CMode"><span class="hs-identifier hs-var">CMode</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Grapheme] -&gt; Grapheme
forall a. [a] -&gt; a
</span><a href="../../base/src/GHC.List.html#head"><span class="hs-identifier hs-var">head</span></a></span><span> </span><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091529"><span class="hs-identifier hs-var">zs</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Grapheme] -&gt; [Grapheme]
forall a. [a] -&gt; [a]
</span><a href="../../base/src/GHC.List.html#tail"><span class="hs-identifier hs-var">tail</span></a></span><span> </span><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091529"><span class="hs-identifier hs-var">zs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-271"></span><span>    </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#moveToStart"><span class="hs-identifier hs-var">moveToStart</span></a></span><span> </span><span class="annot"><span class="annottext">CommandMode
</span><a href="System.Console.Haskeline.LineState.html#CEmpty"><span class="hs-identifier hs-var">CEmpty</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CommandMode
</span><a href="System.Console.Haskeline.LineState.html#CEmpty"><span class="hs-identifier hs-var">CEmpty</span></a></span><span>
</span><span id="line-272"></span><span>
</span><span id="line-273"></span><span>    </span><span id="local-6989586621679091526"><span class="annot"><span class="annottext">moveToEnd :: CommandMode -&gt; CommandMode
</span><a href="#local-6989586621679091526"><span class="hs-identifier hs-var hs-var hs-var hs-var">moveToEnd</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="System.Console.Haskeline.LineState.html#CMode"><span class="hs-identifier hs-type">CMode</span></a></span><span> </span><span id="local-6989586621679091525"><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091525"><span class="hs-identifier hs-var">xs</span></a></span></span><span> </span><span id="local-6989586621679091524"><span class="annot"><span class="annottext">Grapheme
</span><a href="#local-6989586621679091524"><span class="hs-identifier hs-var">c</span></a></span></span><span> </span><span id="local-6989586621679091523"><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091523"><span class="hs-identifier hs-var">ys</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621679091522"><span class="annot"><span class="annottext">zs :: [Grapheme]
</span><a href="#local-6989586621679091522"><span class="hs-identifier hs-var hs-var">zs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Grapheme] -&gt; [Grapheme]
forall a. [a] -&gt; [a]
</span><a href="../../base/src/GHC.List.html#reverse"><span class="hs-identifier hs-var">reverse</span></a></span><span> </span><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091523"><span class="hs-identifier hs-var">ys</span></a></span><span> </span><span class="annot"><span class="annottext">[Grapheme] -&gt; [Grapheme] -&gt; [Grapheme]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Grapheme
</span><a href="#local-6989586621679091524"><span class="hs-identifier hs-var">c</span></a></span><span class="annot"><span class="annottext">Grapheme -&gt; [Grapheme] -&gt; [Grapheme]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091525"><span class="hs-identifier hs-var">xs</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">in</span><span> </span><span class="annot"><span class="annottext">[Grapheme] -&gt; Grapheme -&gt; [Grapheme] -&gt; CommandMode
</span><a href="System.Console.Haskeline.LineState.html#CMode"><span class="hs-identifier hs-var">CMode</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Grapheme] -&gt; [Grapheme]
forall a. [a] -&gt; [a]
</span><a href="../../base/src/GHC.List.html#tail"><span class="hs-identifier hs-var">tail</span></a></span><span> </span><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091522"><span class="hs-identifier hs-var">zs</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Grapheme] -&gt; Grapheme
forall a. [a] -&gt; a
</span><a href="../../base/src/GHC.List.html#head"><span class="hs-identifier hs-var">head</span></a></span><span> </span><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091522"><span class="hs-identifier hs-var">zs</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-274"></span><span>    </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#moveToEnd"><span class="hs-identifier hs-var">moveToEnd</span></a></span><span> </span><span class="annot"><span class="annottext">CommandMode
</span><a href="System.Console.Haskeline.LineState.html#CEmpty"><span class="hs-identifier hs-var">CEmpty</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CommandMode
</span><a href="System.Console.Haskeline.LineState.html#CEmpty"><span class="hs-identifier hs-var">CEmpty</span></a></span><span>
</span><span id="line-275"></span><span>
</span><span id="line-276"></span><span class="annot"><a href="System.Console.Haskeline.LineState.html#deleteChar"><span class="hs-identifier hs-type">deleteChar</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#CommandMode"><span class="hs-identifier hs-type">CommandMode</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#CommandMode"><span class="hs-identifier hs-type">CommandMode</span></a></span><span>
</span><span id="line-277"></span><span id="deleteChar"><span class="annot"><span class="annottext">deleteChar :: CommandMode -&gt; CommandMode
</span><a href="System.Console.Haskeline.LineState.html#deleteChar"><span class="hs-identifier hs-var hs-var">deleteChar</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="System.Console.Haskeline.LineState.html#CMode"><span class="hs-identifier hs-type">CMode</span></a></span><span> </span><span id="local-6989586621679091521"><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091521"><span class="hs-identifier hs-var">xs</span></a></span></span><span> </span><span class="annot"><span class="annottext">Grapheme
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679091520"><span class="annot"><span class="annottext">Grapheme
</span><a href="#local-6989586621679091520"><span class="hs-identifier hs-var">y</span></a></span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span id="local-6989586621679091519"><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091519"><span class="hs-identifier hs-var">ys</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Grapheme] -&gt; Grapheme -&gt; [Grapheme] -&gt; CommandMode
</span><a href="System.Console.Haskeline.LineState.html#CMode"><span class="hs-identifier hs-var">CMode</span></a></span><span> </span><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091521"><span class="hs-identifier hs-var">xs</span></a></span><span> </span><span class="annot"><span class="annottext">Grapheme
</span><a href="#local-6989586621679091520"><span class="hs-identifier hs-var">y</span></a></span><span> </span><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091519"><span class="hs-identifier hs-var">ys</span></a></span><span>
</span><span id="line-278"></span><span class="annot"><a href="System.Console.Haskeline.LineState.html#deleteChar"><span class="hs-identifier hs-var">deleteChar</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="System.Console.Haskeline.LineState.html#CMode"><span class="hs-identifier hs-type">CMode</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679091518"><span class="annot"><span class="annottext">Grapheme
</span><a href="#local-6989586621679091518"><span class="hs-identifier hs-var">x</span></a></span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span id="local-6989586621679091517"><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091517"><span class="hs-identifier hs-var">xs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Grapheme
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Grapheme] -&gt; Grapheme -&gt; [Grapheme] -&gt; CommandMode
</span><a href="System.Console.Haskeline.LineState.html#CMode"><span class="hs-identifier hs-var">CMode</span></a></span><span> </span><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091517"><span class="hs-identifier hs-var">xs</span></a></span><span> </span><span class="annot"><span class="annottext">Grapheme
</span><a href="#local-6989586621679091518"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-279"></span><span class="annot"><a href="System.Console.Haskeline.LineState.html#deleteChar"><span class="hs-identifier hs-var">deleteChar</span></a></span><span> </span><span class="annot"><span class="annottext">CommandMode
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CommandMode
</span><a href="System.Console.Haskeline.LineState.html#CEmpty"><span class="hs-identifier hs-var">CEmpty</span></a></span><span>
</span><span id="line-280"></span><span>
</span><span id="line-281"></span><span class="annot"><a href="System.Console.Haskeline.LineState.html#replaceChar"><span class="hs-identifier hs-type">replaceChar</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Char</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#CommandMode"><span class="hs-identifier hs-type">CommandMode</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#CommandMode"><span class="hs-identifier hs-type">CommandMode</span></a></span><span>
</span><span id="line-282"></span><span id="replaceChar"><span class="annot"><span class="annottext">replaceChar :: Char -&gt; CommandMode -&gt; CommandMode
</span><a href="System.Console.Haskeline.LineState.html#replaceChar"><span class="hs-identifier hs-var hs-var">replaceChar</span></a></span></span><span> </span><span id="local-6989586621679091516"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679091516"><span class="hs-identifier hs-var">c</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="System.Console.Haskeline.LineState.html#CMode"><span class="hs-identifier hs-type">CMode</span></a></span><span> </span><span id="local-6989586621679091515"><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091515"><span class="hs-identifier hs-var">xs</span></a></span></span><span> </span><span id="local-6989586621679091514"><span class="annot"><span class="annottext">Grapheme
</span><a href="#local-6989586621679091514"><span class="hs-identifier hs-var">d</span></a></span></span><span> </span><span id="local-6989586621679091513"><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091513"><span class="hs-identifier hs-var">ys</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-283"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char -&gt; Bool
</span><a href="System.Console.Haskeline.LineState.html#isCombiningChar"><span class="hs-identifier hs-var">isCombiningChar</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679091516"><span class="hs-identifier hs-var">c</span></a></span><span class="hs-special">)</span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Grapheme] -&gt; Grapheme -&gt; [Grapheme] -&gt; CommandMode
</span><a href="System.Console.Haskeline.LineState.html#CMode"><span class="hs-identifier hs-var">CMode</span></a></span><span> </span><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091515"><span class="hs-identifier hs-var">xs</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char -&gt; Grapheme
</span><a href="System.Console.Haskeline.LineState.html#baseGrapheme"><span class="hs-identifier hs-var">baseGrapheme</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679091516"><span class="hs-identifier hs-var">c</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091513"><span class="hs-identifier hs-var">ys</span></a></span><span>
</span><span id="line-284"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>                 </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Grapheme] -&gt; Grapheme -&gt; [Grapheme] -&gt; CommandMode
</span><a href="System.Console.Haskeline.LineState.html#CMode"><span class="hs-identifier hs-var">CMode</span></a></span><span> </span><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091515"><span class="hs-identifier hs-var">xs</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Grapheme -&gt; Char -&gt; Grapheme
</span><a href="System.Console.Haskeline.LineState.html#addCombiner"><span class="hs-identifier hs-var">addCombiner</span></a></span><span> </span><span class="annot"><span class="annottext">Grapheme
</span><a href="#local-6989586621679091514"><span class="hs-identifier hs-var">d</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679091516"><span class="hs-identifier hs-var">c</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091513"><span class="hs-identifier hs-var">ys</span></a></span><span>
</span><span id="line-285"></span><span class="annot"><a href="System.Console.Haskeline.LineState.html#replaceChar"><span class="hs-identifier hs-var">replaceChar</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">CommandMode
</span><a href="System.Console.Haskeline.LineState.html#CEmpty"><span class="hs-identifier hs-var">CEmpty</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CommandMode
</span><a href="System.Console.Haskeline.LineState.html#CEmpty"><span class="hs-identifier hs-var">CEmpty</span></a></span><span>
</span><span id="line-286"></span><span>
</span><span id="line-287"></span><span class="annot"><a href="System.Console.Haskeline.LineState.html#pasteGraphemesBefore"><span class="hs-identifier hs-type">pasteGraphemesBefore</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#pasteGraphemesAfter"><span class="hs-identifier hs-type">pasteGraphemesAfter</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="System.Console.Haskeline.LineState.html#Grapheme"><span class="hs-identifier hs-type">Grapheme</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#CommandMode"><span class="hs-identifier hs-type">CommandMode</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#CommandMode"><span class="hs-identifier hs-type">CommandMode</span></a></span><span>
</span><span id="line-288"></span><span id="pasteGraphemesBefore"><span class="annot"><span class="annottext">pasteGraphemesBefore :: [Grapheme] -&gt; CommandMode -&gt; CommandMode
</span><a href="System.Console.Haskeline.LineState.html#pasteGraphemesBefore"><span class="hs-identifier hs-var hs-var">pasteGraphemesBefore</span></a></span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CommandMode -&gt; CommandMode
forall a. a -&gt; a
</span><a href="../../base/src/GHC.Base.html#id"><span class="hs-identifier hs-var">id</span></a></span><span>
</span><span id="line-289"></span><span class="annot"><a href="System.Console.Haskeline.LineState.html#pasteGraphemesBefore"><span class="hs-identifier hs-var">pasteGraphemesBefore</span></a></span><span> </span><span id="local-6989586621679091511"><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091511"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">InsertMode -&gt; CommandMode
</span><a href="System.Console.Haskeline.LineState.html#enterCommandMode"><span class="hs-identifier hs-var">enterCommandMode</span></a></span><span> </span><span class="annot"><span class="annottext">(InsertMode -&gt; CommandMode)
-&gt; (CommandMode -&gt; InsertMode) -&gt; CommandMode -&gt; CommandMode
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">[Grapheme] -&gt; InsertMode -&gt; InsertMode
</span><a href="System.Console.Haskeline.LineState.html#insertGraphemes"><span class="hs-identifier hs-var">insertGraphemes</span></a></span><span> </span><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091511"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="annot"><span class="annottext">(InsertMode -&gt; InsertMode)
-&gt; (CommandMode -&gt; InsertMode) -&gt; CommandMode -&gt; InsertMode
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">CommandMode -&gt; InsertMode
</span><a href="System.Console.Haskeline.LineState.html#insertFromCommandMode"><span class="hs-identifier hs-var">insertFromCommandMode</span></a></span><span>
</span><span id="line-290"></span><span>
</span><span id="line-291"></span><span id="pasteGraphemesAfter"><span class="annot"><span class="annottext">pasteGraphemesAfter :: [Grapheme] -&gt; CommandMode -&gt; CommandMode
</span><a href="System.Console.Haskeline.LineState.html#pasteGraphemesAfter"><span class="hs-identifier hs-var hs-var">pasteGraphemesAfter</span></a></span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CommandMode -&gt; CommandMode
forall a. a -&gt; a
</span><a href="../../base/src/GHC.Base.html#id"><span class="hs-identifier hs-var">id</span></a></span><span>
</span><span id="line-292"></span><span class="annot"><a href="System.Console.Haskeline.LineState.html#pasteGraphemesAfter"><span class="hs-identifier hs-var">pasteGraphemesAfter</span></a></span><span> </span><span id="local-6989586621679091510"><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091510"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">InsertMode -&gt; CommandMode
</span><a href="System.Console.Haskeline.LineState.html#enterCommandMode"><span class="hs-identifier hs-var">enterCommandMode</span></a></span><span> </span><span class="annot"><span class="annottext">(InsertMode -&gt; CommandMode)
-&gt; (CommandMode -&gt; InsertMode) -&gt; CommandMode -&gt; CommandMode
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">[Grapheme] -&gt; InsertMode -&gt; InsertMode
</span><a href="System.Console.Haskeline.LineState.html#insertGraphemes"><span class="hs-identifier hs-var">insertGraphemes</span></a></span><span> </span><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091510"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="annot"><span class="annottext">(InsertMode -&gt; InsertMode)
-&gt; (CommandMode -&gt; InsertMode) -&gt; CommandMode -&gt; InsertMode
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">CommandMode -&gt; InsertMode
</span><a href="System.Console.Haskeline.LineState.html#appendFromCommandMode"><span class="hs-identifier hs-var">appendFromCommandMode</span></a></span><span>
</span><span id="line-293"></span><span>
</span><span id="line-294"></span><span class="hs-comment">------------------------</span><span>
</span><span id="line-295"></span><span class="hs-comment">-- Transitioning between modes</span><span>
</span><span id="line-296"></span><span>
</span><span id="line-297"></span><span class="annot"><a href="System.Console.Haskeline.LineState.html#enterCommandMode"><span class="hs-identifier hs-type">enterCommandMode</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#enterCommandModeRight"><span class="hs-identifier hs-type">enterCommandModeRight</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#InsertMode"><span class="hs-identifier hs-type">InsertMode</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#CommandMode"><span class="hs-identifier hs-type">CommandMode</span></a></span><span>
</span><span id="line-298"></span><span id="enterCommandMode"><span class="annot"><span class="annottext">enterCommandMode :: InsertMode -&gt; CommandMode
</span><a href="System.Console.Haskeline.LineState.html#enterCommandMode"><span class="hs-identifier hs-var hs-var">enterCommandMode</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="System.Console.Haskeline.LineState.html#IMode"><span class="hs-identifier hs-type">IMode</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679091509"><span class="annot"><span class="annottext">Grapheme
</span><a href="#local-6989586621679091509"><span class="hs-identifier hs-var">x</span></a></span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span id="local-6989586621679091508"><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091508"><span class="hs-identifier hs-var">xs</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679091507"><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091507"><span class="hs-identifier hs-var">ys</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Grapheme] -&gt; Grapheme -&gt; [Grapheme] -&gt; CommandMode
</span><a href="System.Console.Haskeline.LineState.html#CMode"><span class="hs-identifier hs-var">CMode</span></a></span><span> </span><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091508"><span class="hs-identifier hs-var">xs</span></a></span><span> </span><span class="annot"><span class="annottext">Grapheme
</span><a href="#local-6989586621679091509"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091507"><span class="hs-identifier hs-var">ys</span></a></span><span>
</span><span id="line-299"></span><span class="annot"><a href="System.Console.Haskeline.LineState.html#enterCommandMode"><span class="hs-identifier hs-var">enterCommandMode</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="System.Console.Haskeline.LineState.html#IMode"><span class="hs-identifier hs-type">IMode</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-special">(</span><span id="local-6989586621679091506"><span class="annot"><span class="annottext">Grapheme
</span><a href="#local-6989586621679091506"><span class="hs-identifier hs-var">y</span></a></span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span id="local-6989586621679091505"><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091505"><span class="hs-identifier hs-var">ys</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Grapheme] -&gt; Grapheme -&gt; [Grapheme] -&gt; CommandMode
</span><a href="System.Console.Haskeline.LineState.html#CMode"><span class="hs-identifier hs-var">CMode</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">Grapheme
</span><a href="#local-6989586621679091506"><span class="hs-identifier hs-var">y</span></a></span><span> </span><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091505"><span class="hs-identifier hs-var">ys</span></a></span><span>
</span><span id="line-300"></span><span class="annot"><a href="System.Console.Haskeline.LineState.html#enterCommandMode"><span class="hs-identifier hs-var">enterCommandMode</span></a></span><span> </span><span class="annot"><span class="annottext">InsertMode
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CommandMode
</span><a href="System.Console.Haskeline.LineState.html#CEmpty"><span class="hs-identifier hs-var">CEmpty</span></a></span><span>
</span><span id="line-301"></span><span>
</span><span id="line-302"></span><span id="enterCommandModeRight"><span class="annot"><span class="annottext">enterCommandModeRight :: InsertMode -&gt; CommandMode
</span><a href="System.Console.Haskeline.LineState.html#enterCommandModeRight"><span class="hs-identifier hs-var hs-var">enterCommandModeRight</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="System.Console.Haskeline.LineState.html#IMode"><span class="hs-identifier hs-type">IMode</span></a></span><span> </span><span id="local-6989586621679091504"><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091504"><span class="hs-identifier hs-var">xs</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679091503"><span class="annot"><span class="annottext">Grapheme
</span><a href="#local-6989586621679091503"><span class="hs-identifier hs-var">y</span></a></span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span id="local-6989586621679091502"><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091502"><span class="hs-identifier hs-var">ys</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Grapheme] -&gt; Grapheme -&gt; [Grapheme] -&gt; CommandMode
</span><a href="System.Console.Haskeline.LineState.html#CMode"><span class="hs-identifier hs-var">CMode</span></a></span><span> </span><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091504"><span class="hs-identifier hs-var">xs</span></a></span><span> </span><span class="annot"><span class="annottext">Grapheme
</span><a href="#local-6989586621679091503"><span class="hs-identifier hs-var">y</span></a></span><span> </span><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091502"><span class="hs-identifier hs-var">ys</span></a></span><span>
</span><span id="line-303"></span><span class="annot"><a href="System.Console.Haskeline.LineState.html#enterCommandModeRight"><span class="hs-identifier hs-var">enterCommandModeRight</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="System.Console.Haskeline.LineState.html#IMode"><span class="hs-identifier hs-type">IMode</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679091501"><span class="annot"><span class="annottext">Grapheme
</span><a href="#local-6989586621679091501"><span class="hs-identifier hs-var">x</span></a></span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span id="local-6989586621679091500"><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091500"><span class="hs-identifier hs-var">xs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Grapheme] -&gt; Grapheme -&gt; [Grapheme] -&gt; CommandMode
</span><a href="System.Console.Haskeline.LineState.html#CMode"><span class="hs-identifier hs-var">CMode</span></a></span><span> </span><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091500"><span class="hs-identifier hs-var">xs</span></a></span><span> </span><span class="annot"><span class="annottext">Grapheme
</span><a href="#local-6989586621679091501"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-304"></span><span class="annot"><a href="System.Console.Haskeline.LineState.html#enterCommandModeRight"><span class="hs-identifier hs-var">enterCommandModeRight</span></a></span><span> </span><span class="annot"><span class="annottext">InsertMode
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CommandMode
</span><a href="System.Console.Haskeline.LineState.html#CEmpty"><span class="hs-identifier hs-var">CEmpty</span></a></span><span>
</span><span id="line-305"></span><span>
</span><span id="line-306"></span><span>
</span><span id="line-307"></span><span class="annot"><a href="System.Console.Haskeline.LineState.html#insertFromCommandMode"><span class="hs-identifier hs-type">insertFromCommandMode</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#appendFromCommandMode"><span class="hs-identifier hs-type">appendFromCommandMode</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#CommandMode"><span class="hs-identifier hs-type">CommandMode</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#InsertMode"><span class="hs-identifier hs-type">InsertMode</span></a></span><span>
</span><span id="line-308"></span><span>
</span><span id="line-309"></span><span id="insertFromCommandMode"><span class="annot"><span class="annottext">insertFromCommandMode :: CommandMode -&gt; InsertMode
</span><a href="System.Console.Haskeline.LineState.html#insertFromCommandMode"><span class="hs-identifier hs-var hs-var">insertFromCommandMode</span></a></span></span><span> </span><span class="annot"><span class="annottext">CommandMode
</span><a href="System.Console.Haskeline.LineState.html#CEmpty"><span class="hs-identifier hs-var">CEmpty</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">InsertMode
</span><a href="System.Console.Haskeline.LineState.html#emptyIM"><span class="hs-identifier hs-var">emptyIM</span></a></span><span>
</span><span id="line-310"></span><span class="annot"><a href="System.Console.Haskeline.LineState.html#insertFromCommandMode"><span class="hs-identifier hs-var">insertFromCommandMode</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="System.Console.Haskeline.LineState.html#CMode"><span class="hs-identifier hs-type">CMode</span></a></span><span> </span><span id="local-6989586621679091499"><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091499"><span class="hs-identifier hs-var">xs</span></a></span></span><span> </span><span id="local-6989586621679091498"><span class="annot"><span class="annottext">Grapheme
</span><a href="#local-6989586621679091498"><span class="hs-identifier hs-var">c</span></a></span></span><span> </span><span id="local-6989586621679091497"><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091497"><span class="hs-identifier hs-var">ys</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Grapheme] -&gt; [Grapheme] -&gt; InsertMode
</span><a href="System.Console.Haskeline.LineState.html#IMode"><span class="hs-identifier hs-var">IMode</span></a></span><span> </span><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091499"><span class="hs-identifier hs-var">xs</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Grapheme
</span><a href="#local-6989586621679091498"><span class="hs-identifier hs-var">c</span></a></span><span class="annot"><span class="annottext">Grapheme -&gt; [Grapheme] -&gt; [Grapheme]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091497"><span class="hs-identifier hs-var">ys</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-311"></span><span>
</span><span id="line-312"></span><span id="appendFromCommandMode"><span class="annot"><span class="annottext">appendFromCommandMode :: CommandMode -&gt; InsertMode
</span><a href="System.Console.Haskeline.LineState.html#appendFromCommandMode"><span class="hs-identifier hs-var hs-var">appendFromCommandMode</span></a></span></span><span> </span><span class="annot"><span class="annottext">CommandMode
</span><a href="System.Console.Haskeline.LineState.html#CEmpty"><span class="hs-identifier hs-var">CEmpty</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">InsertMode
</span><a href="System.Console.Haskeline.LineState.html#emptyIM"><span class="hs-identifier hs-var">emptyIM</span></a></span><span>
</span><span id="line-313"></span><span class="annot"><a href="System.Console.Haskeline.LineState.html#appendFromCommandMode"><span class="hs-identifier hs-var">appendFromCommandMode</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="System.Console.Haskeline.LineState.html#CMode"><span class="hs-identifier hs-type">CMode</span></a></span><span> </span><span id="local-6989586621679091496"><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091496"><span class="hs-identifier hs-var">xs</span></a></span></span><span> </span><span id="local-6989586621679091495"><span class="annot"><span class="annottext">Grapheme
</span><a href="#local-6989586621679091495"><span class="hs-identifier hs-var">c</span></a></span></span><span> </span><span id="local-6989586621679091494"><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091494"><span class="hs-identifier hs-var">ys</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Grapheme] -&gt; [Grapheme] -&gt; InsertMode
</span><a href="System.Console.Haskeline.LineState.html#IMode"><span class="hs-identifier hs-var">IMode</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Grapheme
</span><a href="#local-6989586621679091495"><span class="hs-identifier hs-var">c</span></a></span><span class="annot"><span class="annottext">Grapheme -&gt; [Grapheme] -&gt; [Grapheme]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091496"><span class="hs-identifier hs-var">xs</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091494"><span class="hs-identifier hs-var">ys</span></a></span><span>
</span><span id="line-314"></span><span>
</span><span id="line-315"></span><span class="annot"><a href="System.Console.Haskeline.LineState.html#withCommandMode"><span class="hs-identifier hs-type">withCommandMode</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="System.Console.Haskeline.LineState.html#InsertMode"><span class="hs-identifier hs-type">InsertMode</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#InsertMode"><span class="hs-identifier hs-type">InsertMode</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#CommandMode"><span class="hs-identifier hs-type">CommandMode</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#CommandMode"><span class="hs-identifier hs-type">CommandMode</span></a></span><span>
</span><span id="line-316"></span><span id="withCommandMode"><span class="annot"><span class="annottext">withCommandMode :: (InsertMode -&gt; InsertMode) -&gt; CommandMode -&gt; CommandMode
</span><a href="System.Console.Haskeline.LineState.html#withCommandMode"><span class="hs-identifier hs-var hs-var">withCommandMode</span></a></span></span><span> </span><span id="local-6989586621679091493"><span class="annot"><span class="annottext">InsertMode -&gt; InsertMode
</span><a href="#local-6989586621679091493"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">InsertMode -&gt; CommandMode
</span><a href="System.Console.Haskeline.LineState.html#enterCommandModeRight"><span class="hs-identifier hs-var">enterCommandModeRight</span></a></span><span> </span><span class="annot"><span class="annottext">(InsertMode -&gt; CommandMode)
-&gt; (CommandMode -&gt; InsertMode) -&gt; CommandMode -&gt; CommandMode
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">InsertMode -&gt; InsertMode
</span><a href="#local-6989586621679091493"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">(InsertMode -&gt; InsertMode)
-&gt; (CommandMode -&gt; InsertMode) -&gt; CommandMode -&gt; InsertMode
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">CommandMode -&gt; InsertMode
</span><a href="System.Console.Haskeline.LineState.html#insertFromCommandMode"><span class="hs-identifier hs-var">insertFromCommandMode</span></a></span><span>
</span><span id="line-317"></span><span>
</span><span id="line-318"></span><span class="hs-comment">----------------------</span><span>
</span><span id="line-319"></span><span class="hs-comment">-- Supplementary modes</span><span>
</span><span id="line-320"></span><span>
</span><span id="line-321"></span><span class="hs-comment">-- | Used for commands which take an integer argument.</span><span>
</span><span id="line-322"></span><span class="hs-keyword">data</span><span> </span><span id="ArgMode"><span class="annot"><a href="System.Console.Haskeline.LineState.html#ArgMode"><span class="hs-identifier hs-var">ArgMode</span></a></span></span><span> </span><span id="local-6989586621679091874"><span class="annot"><a href="#local-6989586621679091874"><span class="hs-identifier hs-type">s</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="ArgMode"><span class="annot"><a href="System.Console.Haskeline.LineState.html#ArgMode"><span class="hs-identifier hs-var">ArgMode</span></a></span></span><span> </span><span class="hs-special">{</span><span id="arg"><span class="annot"><span class="annottext">forall s. ArgMode s -&gt; Int
</span><a href="System.Console.Haskeline.LineState.html#arg"><span class="hs-identifier hs-var hs-var">arg</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span class="hs-special">,</span><span> </span><span id="argState"><span class="annot"><span class="annottext">forall s. ArgMode s -&gt; s
</span><a href="System.Console.Haskeline.LineState.html#argState"><span class="hs-identifier hs-var hs-var">argState</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="#local-6989586621679091874"><span class="hs-identifier hs-type">s</span></a></span><span class="hs-special">}</span><span>
</span><span id="line-323"></span><span>
</span><span id="line-324"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679091487"><span class="annot"><a href="../../base/src/GHC.Base.html#Functor"><span class="hs-identifier hs-type">Functor</span></a></span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#ArgMode"><span class="hs-identifier hs-type">ArgMode</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-325"></span><span>    </span><span id="local-6989586621679091485"><span class="annot"><span class="annottext">fmap :: forall a b. (a -&gt; b) -&gt; ArgMode a -&gt; ArgMode b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var hs-var hs-var hs-var">fmap</span></a></span></span><span> </span><span id="local-6989586621679091484"><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679091484"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621679091483"><span class="annot"><span class="annottext">ArgMode a
</span><a href="#local-6989586621679091483"><span class="hs-identifier hs-var">am</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ArgMode a
</span><a href="#local-6989586621679091483"><span class="hs-identifier hs-var">am</span></a></span><span> </span><span class="hs-special">{</span><span class="annot"><span class="annottext">argState :: b
</span><a href="System.Console.Haskeline.LineState.html#argState"><span class="hs-identifier hs-var">argState</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679091484"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ArgMode a -&gt; a
forall s. ArgMode s -&gt; s
</span><a href="System.Console.Haskeline.LineState.html#argState"><span class="hs-identifier hs-var hs-var">argState</span></a></span><span> </span><span class="annot"><span class="annottext">ArgMode a
</span><a href="#local-6989586621679091483"><span class="hs-identifier hs-var">am</span></a></span><span class="hs-special">)</span><span class="hs-special">}</span><span>
</span><span id="line-326"></span><span>
</span><span id="line-327"></span><span id="local-6989586621679091863"><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#LineState"><span class="hs-identifier hs-type">LineState</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679091863"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#LineState"><span class="hs-identifier hs-type">LineState</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="System.Console.Haskeline.LineState.html#ArgMode"><span class="hs-identifier hs-type">ArgMode</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679091863"><span class="hs-identifier hs-type">s</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-328"></span><span>    </span><span id="local-6989586621679091477"><span class="annot"><span class="annottext">beforeCursor :: [Grapheme] -&gt; ArgMode s -&gt; [Grapheme]
</span><a href="#local-6989586621679091477"><span class="hs-identifier hs-var hs-var hs-var hs-var">beforeCursor</span></a></span></span><span> </span><span class="annot"><span class="annottext">[Grapheme]
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621679091476"><span class="annot"><span class="annottext">ArgMode s
</span><a href="#local-6989586621679091476"><span class="hs-identifier hs-var">am</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621679091473"><span class="annot"><span class="annottext">pre :: [Grapheme]
</span><a href="#local-6989586621679091473"><span class="hs-identifier hs-var hs-var">pre</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Char -&gt; Grapheme) -&gt; [Char] -&gt; [Grapheme]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">Char -&gt; Grapheme
</span><a href="System.Console.Haskeline.LineState.html#baseGrapheme"><span class="hs-identifier hs-var">baseGrapheme</span></a></span><span> </span><span class="annot"><span class="annottext">([Char] -&gt; [Grapheme]) -&gt; [Char] -&gt; [Grapheme]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-string">&quot;(arg: &quot;</span></span><span> </span><span class="annot"><span class="annottext">[Char] -&gt; ShowS
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; [Char]
forall a. Show a =&gt; a -&gt; [Char]
</span><a href="../../base/src/GHC.Show.html#show"><span class="hs-identifier hs-var">show</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ArgMode s -&gt; Int
forall s. ArgMode s -&gt; Int
</span><a href="System.Console.Haskeline.LineState.html#arg"><span class="hs-identifier hs-var hs-var">arg</span></a></span><span> </span><span class="annot"><span class="annottext">ArgMode s
</span><a href="#local-6989586621679091476"><span class="hs-identifier hs-var">am</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Char] -&gt; ShowS
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-string">&quot;) &quot;</span></span><span>
</span><span id="line-329"></span><span>                             </span><span class="hs-keyword">in</span><span> </span><span class="annot"><span class="annottext">[Grapheme] -&gt; s -&gt; [Grapheme]
forall s. LineState s =&gt; [Grapheme] -&gt; s -&gt; [Grapheme]
</span><a href="System.Console.Haskeline.LineState.html#beforeCursor"><span class="hs-identifier hs-var">beforeCursor</span></a></span><span> </span><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091473"><span class="hs-identifier hs-var">pre</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ArgMode s -&gt; s
forall s. ArgMode s -&gt; s
</span><a href="System.Console.Haskeline.LineState.html#argState"><span class="hs-identifier hs-var hs-var">argState</span></a></span><span> </span><span class="annot"><span class="annottext">ArgMode s
</span><a href="#local-6989586621679091476"><span class="hs-identifier hs-var">am</span></a></span><span class="hs-special">)</span><span> </span><span>
</span><span id="line-330"></span><span>    </span><span id="local-6989586621679091471"><span class="annot"><span class="annottext">afterCursor :: ArgMode s -&gt; [Grapheme]
</span><a href="#local-6989586621679091471"><span class="hs-identifier hs-var hs-var hs-var hs-var">afterCursor</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">s -&gt; [Grapheme]
forall s. LineState s =&gt; s -&gt; [Grapheme]
</span><a href="System.Console.Haskeline.LineState.html#afterCursor"><span class="hs-identifier hs-var">afterCursor</span></a></span><span> </span><span class="annot"><span class="annottext">(s -&gt; [Grapheme]) -&gt; (ArgMode s -&gt; s) -&gt; ArgMode s -&gt; [Grapheme]
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">ArgMode s -&gt; s
forall s. ArgMode s -&gt; s
</span><a href="System.Console.Haskeline.LineState.html#argState"><span class="hs-identifier hs-var hs-var">argState</span></a></span></span><span>
</span><span id="line-331"></span><span>
</span><span id="line-332"></span><span id="local-6989586621679091861"><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#Result"><span class="hs-identifier hs-type">Result</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679091861"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#Result"><span class="hs-identifier hs-type">Result</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="System.Console.Haskeline.LineState.html#ArgMode"><span class="hs-identifier hs-type">ArgMode</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679091861"><span class="hs-identifier hs-type">s</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-333"></span><span>    </span><span id="local-6989586621679091463"><span class="annot"><span class="annottext">toResult :: ArgMode s -&gt; [Char]
</span><a href="#local-6989586621679091463"><span class="hs-identifier hs-var hs-var hs-var hs-var">toResult</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">s -&gt; [Char]
forall s. Result s =&gt; s -&gt; [Char]
</span><a href="System.Console.Haskeline.LineState.html#toResult"><span class="hs-identifier hs-var">toResult</span></a></span><span> </span><span class="annot"><span class="annottext">(s -&gt; [Char]) -&gt; (ArgMode s -&gt; s) -&gt; ArgMode s -&gt; [Char]
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">ArgMode s -&gt; s
forall s. ArgMode s -&gt; s
</span><a href="System.Console.Haskeline.LineState.html#argState"><span class="hs-identifier hs-var hs-var">argState</span></a></span></span><span>
</span><span id="line-334"></span><span>
</span><span id="line-335"></span><span id="local-6989586621679091859"><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#Save"><span class="hs-identifier hs-type">Save</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679091859"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#Save"><span class="hs-identifier hs-type">Save</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="System.Console.Haskeline.LineState.html#ArgMode"><span class="hs-identifier hs-type">ArgMode</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679091859"><span class="hs-identifier hs-type">s</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-336"></span><span>    </span><span id="local-6989586621679091454"><span class="annot"><span class="annottext">save :: ArgMode s -&gt; InsertMode
</span><a href="#local-6989586621679091454"><span class="hs-identifier hs-var hs-var hs-var hs-var">save</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">s -&gt; InsertMode
forall s. Save s =&gt; s -&gt; InsertMode
</span><a href="System.Console.Haskeline.LineState.html#save"><span class="hs-identifier hs-var">save</span></a></span><span> </span><span class="annot"><span class="annottext">(s -&gt; InsertMode) -&gt; (ArgMode s -&gt; s) -&gt; ArgMode s -&gt; InsertMode
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">ArgMode s -&gt; s
forall s. ArgMode s -&gt; s
</span><a href="System.Console.Haskeline.LineState.html#argState"><span class="hs-identifier hs-var hs-var">argState</span></a></span><span>
</span><span id="line-337"></span><span>    </span><span id="local-6989586621679091452"><span class="annot"><span class="annottext">restore :: InsertMode -&gt; ArgMode s
</span><a href="#local-6989586621679091452"><span class="hs-identifier hs-var hs-var hs-var hs-var">restore</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; s -&gt; ArgMode s
forall s. Int -&gt; s -&gt; ArgMode s
</span><a href="System.Console.Haskeline.LineState.html#startArg"><span class="hs-identifier hs-var">startArg</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span> </span><span class="annot"><span class="annottext">(s -&gt; ArgMode s) -&gt; (InsertMode -&gt; s) -&gt; InsertMode -&gt; ArgMode s
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">InsertMode -&gt; s
forall s. Save s =&gt; InsertMode -&gt; s
</span><a href="System.Console.Haskeline.LineState.html#restore"><span class="hs-identifier hs-var">restore</span></a></span></span><span>
</span><span id="line-338"></span><span>
</span><span id="line-339"></span><span id="local-6989586621679091858"><span class="annot"><a href="System.Console.Haskeline.LineState.html#startArg"><span class="hs-identifier hs-type">startArg</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679091858"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#ArgMode"><span class="hs-identifier hs-type">ArgMode</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679091858"><span class="hs-identifier hs-type">s</span></a></span></span><span>
</span><span id="line-340"></span><span id="startArg"><span class="annot"><span class="annottext">startArg :: forall s. Int -&gt; s -&gt; ArgMode s
</span><a href="System.Console.Haskeline.LineState.html#startArg"><span class="hs-identifier hs-var hs-var">startArg</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; s -&gt; ArgMode s
forall s. Int -&gt; s -&gt; ArgMode s
</span><a href="System.Console.Haskeline.LineState.html#ArgMode"><span class="hs-identifier hs-var">ArgMode</span></a></span><span>
</span><span id="line-341"></span><span>
</span><span id="line-342"></span><span id="local-6989586621679091856"><span class="annot"><a href="System.Console.Haskeline.LineState.html#addNum"><span class="hs-identifier hs-type">addNum</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#ArgMode"><span class="hs-identifier hs-type">ArgMode</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679091856"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#ArgMode"><span class="hs-identifier hs-type">ArgMode</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679091856"><span class="hs-identifier hs-type">s</span></a></span></span><span>
</span><span id="line-343"></span><span id="addNum"><span class="annot"><span class="annottext">addNum :: forall s. Int -&gt; ArgMode s -&gt; ArgMode s
</span><a href="System.Console.Haskeline.LineState.html#addNum"><span class="hs-identifier hs-var hs-var">addNum</span></a></span></span><span> </span><span id="local-6989586621679091445"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679091445"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span id="local-6989586621679091444"><span class="annot"><span class="annottext">ArgMode s
</span><a href="#local-6989586621679091444"><span class="hs-identifier hs-var">am</span></a></span></span><span>
</span><span id="line-344"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">ArgMode s -&gt; Int
forall s. ArgMode s -&gt; Int
</span><a href="System.Console.Haskeline.LineState.html#arg"><span class="hs-identifier hs-var hs-var">arg</span></a></span><span> </span><span class="annot"><span class="annottext">ArgMode s
</span><a href="#local-6989586621679091444"><span class="hs-identifier hs-var">am</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&gt;=</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1000</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ArgMode s
</span><a href="#local-6989586621679091444"><span class="hs-identifier hs-var">am</span></a></span><span> </span><span class="hs-comment">-- shouldn't ever need more than 4 digits</span><span>
</span><span id="line-345"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ArgMode s
</span><a href="#local-6989586621679091444"><span class="hs-identifier hs-var">am</span></a></span><span> </span><span class="hs-special">{</span><span class="annot"><span class="annottext">arg :: Int
</span><a href="System.Console.Haskeline.LineState.html#arg"><span class="hs-identifier hs-var">arg</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ArgMode s -&gt; Int
forall s. ArgMode s -&gt; Int
</span><a href="System.Console.Haskeline.LineState.html#arg"><span class="hs-identifier hs-var hs-var">arg</span></a></span><span> </span><span class="annot"><span class="annottext">ArgMode s
</span><a href="#local-6989586621679091444"><span class="hs-identifier hs-var">am</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2A"><span class="hs-operator hs-var">*</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">10</span></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679091445"><span class="hs-identifier hs-var">n</span></a></span><span class="hs-special">}</span><span> </span><span>
</span><span id="line-346"></span><span>
</span><span id="line-347"></span><span class="hs-comment">-- todo: negatives</span><span>
</span><span id="line-348"></span><span id="local-6989586621679091852"><span class="annot"><a href="System.Console.Haskeline.LineState.html#applyArg"><span class="hs-identifier hs-type">applyArg</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679091852"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679091852"><span class="hs-identifier hs-type">s</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#ArgMode"><span class="hs-identifier hs-type">ArgMode</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679091852"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679091852"><span class="hs-identifier hs-type">s</span></a></span></span><span>
</span><span id="line-349"></span><span id="applyArg"><span class="annot"><span class="annottext">applyArg :: forall s. (s -&gt; s) -&gt; ArgMode s -&gt; s
</span><a href="System.Console.Haskeline.LineState.html#applyArg"><span class="hs-identifier hs-var hs-var">applyArg</span></a></span></span><span> </span><span id="local-6989586621679091441"><span class="annot"><span class="annottext">s -&gt; s
</span><a href="#local-6989586621679091441"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621679091440"><span class="annot"><span class="annottext">ArgMode s
</span><a href="#local-6989586621679091440"><span class="hs-identifier hs-var">am</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; (s -&gt; s) -&gt; s -&gt; s
forall a. Int -&gt; (a -&gt; a) -&gt; a -&gt; a
</span><a href="System.Console.Haskeline.LineState.html#repeatN"><span class="hs-identifier hs-var">repeatN</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ArgMode s -&gt; Int
forall s. ArgMode s -&gt; Int
</span><a href="System.Console.Haskeline.LineState.html#arg"><span class="hs-identifier hs-var hs-var">arg</span></a></span><span> </span><span class="annot"><span class="annottext">ArgMode s
</span><a href="#local-6989586621679091440"><span class="hs-identifier hs-var">am</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">s -&gt; s
</span><a href="#local-6989586621679091441"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ArgMode s -&gt; s
forall s. ArgMode s -&gt; s
</span><a href="System.Console.Haskeline.LineState.html#argState"><span class="hs-identifier hs-var hs-var">argState</span></a></span><span> </span><span class="annot"><span class="annottext">ArgMode s
</span><a href="#local-6989586621679091440"><span class="hs-identifier hs-var">am</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-350"></span><span>
</span><span id="line-351"></span><span id="local-6989586621679091850"><span class="annot"><a href="System.Console.Haskeline.LineState.html#repeatN"><span class="hs-identifier hs-type">repeatN</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679091850"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679091850"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679091850"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679091850"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-352"></span><span id="repeatN"><span class="annot"><span class="annottext">repeatN :: forall a. Int -&gt; (a -&gt; a) -&gt; a -&gt; a
</span><a href="System.Console.Haskeline.LineState.html#repeatN"><span class="hs-identifier hs-var hs-var">repeatN</span></a></span></span><span> </span><span id="local-6989586621679091434"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679091434"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span id="local-6989586621679091433"><span class="annot"><span class="annottext">a -&gt; a
</span><a href="#local-6989586621679091433"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679091434"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&lt;=</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a -&gt; a
</span><a href="#local-6989586621679091433"><span class="hs-identifier hs-var">f</span></a></span><span>
</span><span id="line-353"></span><span>          </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a -&gt; a
</span><a href="#local-6989586621679091433"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">(a -&gt; a) -&gt; (a -&gt; a) -&gt; a -&gt; a
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; (a -&gt; a) -&gt; a -&gt; a
forall a. Int -&gt; (a -&gt; a) -&gt; a -&gt; a
</span><a href="System.Console.Haskeline.LineState.html#repeatN"><span class="hs-identifier hs-var">repeatN</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679091434"><span class="hs-identifier hs-var">n</span></a></span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">a -&gt; a
</span><a href="#local-6989586621679091433"><span class="hs-identifier hs-var">f</span></a></span><span>
</span><span id="line-354"></span><span>
</span><span id="line-355"></span><span class="annot"><a href="System.Console.Haskeline.LineState.html#applyCmdArg"><span class="hs-identifier hs-type">applyCmdArg</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="System.Console.Haskeline.LineState.html#InsertMode"><span class="hs-identifier hs-type">InsertMode</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#InsertMode"><span class="hs-identifier hs-type">InsertMode</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#ArgMode"><span class="hs-identifier hs-type">ArgMode</span></a></span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#CommandMode"><span class="hs-identifier hs-type">CommandMode</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#CommandMode"><span class="hs-identifier hs-type">CommandMode</span></a></span><span>
</span><span id="line-356"></span><span id="applyCmdArg"><span class="annot"><span class="annottext">applyCmdArg :: (InsertMode -&gt; InsertMode) -&gt; ArgMode CommandMode -&gt; CommandMode
</span><a href="System.Console.Haskeline.LineState.html#applyCmdArg"><span class="hs-identifier hs-var hs-var">applyCmdArg</span></a></span></span><span> </span><span id="local-6989586621679091431"><span class="annot"><span class="annottext">InsertMode -&gt; InsertMode
</span><a href="#local-6989586621679091431"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621679091430"><span class="annot"><span class="annottext">ArgMode CommandMode
</span><a href="#local-6989586621679091430"><span class="hs-identifier hs-var">am</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(InsertMode -&gt; InsertMode) -&gt; CommandMode -&gt; CommandMode
</span><a href="System.Console.Haskeline.LineState.html#withCommandMode"><span class="hs-identifier hs-var">withCommandMode</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; (InsertMode -&gt; InsertMode) -&gt; InsertMode -&gt; InsertMode
forall a. Int -&gt; (a -&gt; a) -&gt; a -&gt; a
</span><a href="System.Console.Haskeline.LineState.html#repeatN"><span class="hs-identifier hs-var">repeatN</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ArgMode CommandMode -&gt; Int
forall s. ArgMode s -&gt; Int
</span><a href="System.Console.Haskeline.LineState.html#arg"><span class="hs-identifier hs-var hs-var">arg</span></a></span><span> </span><span class="annot"><span class="annottext">ArgMode CommandMode
</span><a href="#local-6989586621679091430"><span class="hs-identifier hs-var">am</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">InsertMode -&gt; InsertMode
</span><a href="#local-6989586621679091431"><span class="hs-identifier hs-var">f</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ArgMode CommandMode -&gt; CommandMode
forall s. ArgMode s -&gt; s
</span><a href="System.Console.Haskeline.LineState.html#argState"><span class="hs-identifier hs-var hs-var">argState</span></a></span><span> </span><span class="annot"><span class="annottext">ArgMode CommandMode
</span><a href="#local-6989586621679091430"><span class="hs-identifier hs-var">am</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-357"></span><span>
</span><span id="line-358"></span><span class="hs-comment">---------------</span><span>
</span><span id="line-359"></span><span class="hs-keyword">newtype</span><span> </span><span id="Message"><span class="annot"><a href="System.Console.Haskeline.LineState.html#Message"><span class="hs-identifier hs-var">Message</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="Message"><span class="annot"><a href="System.Console.Haskeline.LineState.html#Message"><span class="hs-identifier hs-var">Message</span></a></span></span><span> </span><span class="hs-special">{</span><span id="messageText"><span class="annot"><span class="annottext">Message -&gt; [Char]
</span><a href="System.Console.Haskeline.LineState.html#messageText"><span class="hs-identifier hs-var hs-var">messageText</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">}</span><span>
</span><span id="line-360"></span><span>
</span><span id="line-361"></span><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#LineState"><span class="hs-identifier hs-type">LineState</span></a></span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#Message"><span class="hs-identifier hs-type">Message</span></a></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-362"></span><span>    </span><span id="local-6989586621679091424"><span class="annot"><span class="annottext">beforeCursor :: [Grapheme] -&gt; Message -&gt; [Grapheme]
</span><a href="#local-6989586621679091424"><span class="hs-identifier hs-var hs-var hs-var hs-var">beforeCursor</span></a></span></span><span> </span><span class="annot"><span class="annottext">[Grapheme]
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Char] -&gt; [Grapheme]
</span><a href="System.Console.Haskeline.LineState.html#stringToGraphemes"><span class="hs-identifier hs-var">stringToGraphemes</span></a></span><span> </span><span class="annot"><span class="annottext">([Char] -&gt; [Grapheme])
-&gt; (Message -&gt; [Char]) -&gt; Message -&gt; [Grapheme]
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Message -&gt; [Char]
</span><a href="System.Console.Haskeline.LineState.html#messageText"><span class="hs-identifier hs-var hs-var">messageText</span></a></span><span>
</span><span id="line-363"></span><span>    </span><span id="local-6989586621679091423"><span class="annot"><span class="annottext">afterCursor :: Message -&gt; [Grapheme]
</span><a href="#local-6989586621679091423"><span class="hs-identifier hs-var hs-var hs-var hs-var">afterCursor</span></a></span></span><span> </span><span class="annot"><span class="annottext">Message
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-364"></span><span>
</span><span id="line-365"></span><span class="hs-comment">----------------</span><span>
</span><span id="line-366"></span><span>
</span><span id="line-367"></span><span class="hs-keyword">data</span><span> </span><span id="Password"><span class="annot"><a href="System.Console.Haskeline.LineState.html#Password"><span class="hs-identifier hs-var">Password</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="Password"><span class="annot"><a href="System.Console.Haskeline.LineState.html#Password"><span class="hs-identifier hs-var">Password</span></a></span></span><span> </span><span class="hs-special">{</span><span id="passwordState"><span class="annot"><span class="annottext">Password -&gt; [Char]
</span><a href="System.Console.Haskeline.LineState.html#passwordState"><span class="hs-identifier hs-var hs-var">passwordState</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="hs-identifier hs-type">Char</span></span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="hs-comment">-- ^ reversed</span><span>
</span><span id="line-368"></span><span>                          </span><span id="passwordChar"><span class="annot"><span class="annottext">Password -&gt; Maybe Char
</span><a href="System.Console.Haskeline.LineState.html#passwordChar"><span class="hs-identifier hs-var hs-var">passwordChar</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><span class="hs-identifier hs-type">Char</span></span><span class="hs-special">}</span><span>
</span><span id="line-369"></span><span>
</span><span id="line-370"></span><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#LineState"><span class="hs-identifier hs-type">LineState</span></a></span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#Password"><span class="hs-identifier hs-type">Password</span></a></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-371"></span><span>    </span><span id="local-6989586621679091415"><span class="annot"><span class="annottext">beforeCursor :: [Grapheme] -&gt; Password -&gt; [Grapheme]
</span><a href="#local-6989586621679091415"><span class="hs-identifier hs-var hs-var hs-var hs-var">beforeCursor</span></a></span></span><span> </span><span id="local-6989586621679091414"><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091414"><span class="hs-identifier hs-var">prefix</span></a></span></span><span> </span><span id="local-6989586621679091413"><span class="annot"><span class="annottext">Password
</span><a href="#local-6989586621679091413"><span class="hs-identifier hs-var">p</span></a></span></span><span>
</span><span id="line-372"></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091414"><span class="hs-identifier hs-var">prefix</span></a></span><span> </span><span class="annot"><span class="annottext">[Grapheme] -&gt; [Grapheme] -&gt; [Grapheme]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Char] -&gt; [Grapheme]
</span><a href="System.Console.Haskeline.LineState.html#stringToGraphemes"><span class="hs-identifier hs-var">stringToGraphemes</span></a></span><span>
</span><span id="line-373"></span><span>                      </span><span class="annot"><span class="annottext">([Char] -&gt; [Grapheme]) -&gt; [Char] -&gt; [Grapheme]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Password -&gt; Maybe Char
</span><a href="System.Console.Haskeline.LineState.html#passwordChar"><span class="hs-identifier hs-var hs-var">passwordChar</span></a></span><span> </span><span class="annot"><span class="annottext">Password
</span><a href="#local-6989586621679091413"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-374"></span><span>                        </span><span class="annot"><span class="annottext">Maybe Char
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-375"></span><span>                        </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621679091412"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679091412"><span class="hs-identifier hs-var">c</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Char -&gt; [Char]
forall a. Int -&gt; a -&gt; [a]
</span><a href="../../base/src/GHC.List.html#replicate"><span class="hs-identifier hs-var">replicate</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Char] -&gt; Int
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Int
</span><a href="../../base/src/Data.Foldable.html#length"><span class="hs-identifier hs-var">length</span></a></span><span> </span><span class="annot"><span class="annottext">([Char] -&gt; Int) -&gt; [Char] -&gt; Int
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Password -&gt; [Char]
</span><a href="System.Console.Haskeline.LineState.html#passwordState"><span class="hs-identifier hs-var hs-var">passwordState</span></a></span><span> </span><span class="annot"><span class="annottext">Password
</span><a href="#local-6989586621679091413"><span class="hs-identifier hs-var">p</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679091412"><span class="hs-identifier hs-var">c</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-376"></span><span>    </span><span id="local-6989586621679091410"><span class="annot"><span class="annottext">afterCursor :: Password -&gt; [Grapheme]
</span><a href="#local-6989586621679091410"><span class="hs-identifier hs-var hs-var hs-var hs-var">afterCursor</span></a></span></span><span> </span><span class="annot"><span class="annottext">Password
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-377"></span><span>
</span><span id="line-378"></span><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#Result"><span class="hs-identifier hs-type">Result</span></a></span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#Password"><span class="hs-identifier hs-type">Password</span></a></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-379"></span><span>    </span><span id="local-6989586621679091405"><span class="annot"><span class="annottext">toResult :: Password -&gt; [Char]
</span><a href="#local-6989586621679091405"><span class="hs-identifier hs-var hs-var hs-var hs-var">toResult</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ShowS
forall a. [a] -&gt; [a]
</span><a href="../../base/src/GHC.List.html#reverse"><span class="hs-identifier hs-var">reverse</span></a></span><span> </span><span class="annot"><span class="annottext">ShowS -&gt; (Password -&gt; [Char]) -&gt; Password -&gt; [Char]
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Password -&gt; [Char]
</span><a href="System.Console.Haskeline.LineState.html#passwordState"><span class="hs-identifier hs-var hs-var">passwordState</span></a></span><span>
</span><span id="line-380"></span><span>
</span><span id="line-381"></span><span class="annot"><a href="System.Console.Haskeline.LineState.html#addPasswordChar"><span class="hs-identifier hs-type">addPasswordChar</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Char</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#Password"><span class="hs-identifier hs-type">Password</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#Password"><span class="hs-identifier hs-type">Password</span></a></span><span>
</span><span id="line-382"></span><span id="addPasswordChar"><span class="annot"><span class="annottext">addPasswordChar :: Char -&gt; Password -&gt; Password
</span><a href="System.Console.Haskeline.LineState.html#addPasswordChar"><span class="hs-identifier hs-var hs-var">addPasswordChar</span></a></span></span><span> </span><span id="local-6989586621679091404"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679091404"><span class="hs-identifier hs-var">c</span></a></span></span><span> </span><span id="local-6989586621679091403"><span class="annot"><span class="annottext">Password
</span><a href="#local-6989586621679091403"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Password
</span><a href="#local-6989586621679091403"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="hs-special">{</span><span class="annot"><span class="annottext">passwordState :: [Char]
</span><a href="System.Console.Haskeline.LineState.html#passwordState"><span class="hs-identifier hs-var">passwordState</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679091404"><span class="hs-identifier hs-var">c</span></a></span><span> </span><span class="annot"><span class="annottext">Char -&gt; ShowS
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">Password -&gt; [Char]
</span><a href="System.Console.Haskeline.LineState.html#passwordState"><span class="hs-identifier hs-var hs-var">passwordState</span></a></span><span> </span><span class="annot"><span class="annottext">Password
</span><a href="#local-6989586621679091403"><span class="hs-identifier hs-var">p</span></a></span><span class="hs-special">}</span><span>
</span><span id="line-383"></span><span>
</span><span id="line-384"></span><span class="annot"><a href="System.Console.Haskeline.LineState.html#deletePasswordChar"><span class="hs-identifier hs-type">deletePasswordChar</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#Password"><span class="hs-identifier hs-type">Password</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#Password"><span class="hs-identifier hs-type">Password</span></a></span><span>
</span><span id="line-385"></span><span id="deletePasswordChar"><span class="annot"><span class="annottext">deletePasswordChar :: Password -&gt; Password
</span><a href="System.Console.Haskeline.LineState.html#deletePasswordChar"><span class="hs-identifier hs-var hs-var">deletePasswordChar</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="System.Console.Haskeline.LineState.html#Password"><span class="hs-identifier hs-type">Password</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char
</span><span class="hs-identifier">_</span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span id="local-6989586621679091402"><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621679091402"><span class="hs-identifier hs-var">cs</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679091401"><span class="annot"><span class="annottext">Maybe Char
</span><a href="#local-6989586621679091401"><span class="hs-identifier hs-var">m</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Char] -&gt; Maybe Char -&gt; Password
</span><a href="System.Console.Haskeline.LineState.html#Password"><span class="hs-identifier hs-var">Password</span></a></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621679091402"><span class="hs-identifier hs-var">cs</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe Char
</span><a href="#local-6989586621679091401"><span class="hs-identifier hs-var">m</span></a></span><span>
</span><span id="line-386"></span><span class="annot"><a href="System.Console.Haskeline.LineState.html#deletePasswordChar"><span class="hs-identifier hs-var">deletePasswordChar</span></a></span><span> </span><span id="local-6989586621679091400"><span class="annot"><span class="annottext">Password
</span><a href="#local-6989586621679091400"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Password
</span><a href="#local-6989586621679091400"><span class="hs-identifier hs-var">p</span></a></span><span>
</span><span id="line-387"></span><span>
</span><span id="line-388"></span><span class="hs-comment">-----------------</span><span>
</span><span id="line-389"></span><span class="annot"><a href="System.Console.Haskeline.LineState.html#atStart"><span class="hs-identifier hs-type">atStart</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#atEnd"><span class="hs-identifier hs-type">atEnd</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier hs-type">Char</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#InsertMode"><span class="hs-identifier hs-type">InsertMode</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-390"></span><span id="atStart"><span class="annot"><span class="annottext">atStart :: (Char -&gt; Bool) -&gt; InsertMode -&gt; Bool
</span><a href="System.Console.Haskeline.LineState.html#atStart"><span class="hs-identifier hs-var hs-var">atStart</span></a></span></span><span> </span><span id="local-6989586621679091399"><span class="annot"><span class="annottext">Char -&gt; Bool
</span><a href="#local-6989586621679091399"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="System.Console.Haskeline.LineState.html#IMode"><span class="hs-identifier hs-type">IMode</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679091398"><span class="annot"><span class="annottext">Grapheme
</span><a href="#local-6989586621679091398"><span class="hs-identifier hs-var">x</span></a></span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span class="annot"><span class="annottext">[Grapheme]
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span id="local-6989586621679091397"><span class="annot"><span class="annottext">Grapheme
</span><a href="#local-6989586621679091397"><span class="hs-identifier hs-var">y</span></a></span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span class="annot"><span class="annottext">[Grapheme]
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char -&gt; Bool
</span><a href="#local-6989586621679091399"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Grapheme -&gt; Char
</span><a href="System.Console.Haskeline.LineState.html#baseChar"><span class="hs-identifier hs-var">baseChar</span></a></span><span> </span><span class="annot"><span class="annottext">Grapheme
</span><a href="#local-6989586621679091398"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">Char -&gt; Bool
</span><a href="#local-6989586621679091399"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Grapheme -&gt; Char
</span><a href="System.Console.Haskeline.LineState.html#baseChar"><span class="hs-identifier hs-var">baseChar</span></a></span><span> </span><span class="annot"><span class="annottext">Grapheme
</span><a href="#local-6989586621679091397"><span class="hs-identifier hs-var">y</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-391"></span><span class="annot"><a href="System.Console.Haskeline.LineState.html#atStart"><span class="hs-identifier hs-var">atStart</span></a></span><span> </span><span class="annot"><span class="annottext">Char -&gt; Bool
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">InsertMode
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-392"></span><span>
</span><span id="line-393"></span><span id="atEnd"><span class="annot"><span class="annottext">atEnd :: (Char -&gt; Bool) -&gt; InsertMode -&gt; Bool
</span><a href="System.Console.Haskeline.LineState.html#atEnd"><span class="hs-identifier hs-var hs-var">atEnd</span></a></span></span><span> </span><span id="local-6989586621679091395"><span class="annot"><span class="annottext">Char -&gt; Bool
</span><a href="#local-6989586621679091395"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="System.Console.Haskeline.LineState.html#IMode"><span class="hs-identifier hs-type">IMode</span></a></span><span> </span><span class="annot"><span class="annottext">[Grapheme]
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679091394"><span class="annot"><span class="annottext">Grapheme
</span><a href="#local-6989586621679091394"><span class="hs-identifier hs-var">y1</span></a></span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span id="local-6989586621679091393"><span class="annot"><span class="annottext">Grapheme
</span><a href="#local-6989586621679091393"><span class="hs-identifier hs-var">y2</span></a></span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span class="annot"><span class="annottext">[Grapheme]
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Char -&gt; Bool
</span><a href="#local-6989586621679091395"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Grapheme -&gt; Char
</span><a href="System.Console.Haskeline.LineState.html#baseChar"><span class="hs-identifier hs-var">baseChar</span></a></span><span> </span><span class="annot"><span class="annottext">Grapheme
</span><a href="#local-6989586621679091394"><span class="hs-identifier hs-var">y1</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char -&gt; Bool
</span><a href="#local-6989586621679091395"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Grapheme -&gt; Char
</span><a href="System.Console.Haskeline.LineState.html#baseChar"><span class="hs-identifier hs-var">baseChar</span></a></span><span> </span><span class="annot"><span class="annottext">Grapheme
</span><a href="#local-6989586621679091393"><span class="hs-identifier hs-var">y2</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-394"></span><span class="annot"><a href="System.Console.Haskeline.LineState.html#atEnd"><span class="hs-identifier hs-var">atEnd</span></a></span><span> </span><span class="annot"><span class="annottext">Char -&gt; Bool
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">InsertMode
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-395"></span><span>
</span><span id="line-396"></span><span class="annot"><a href="System.Console.Haskeline.LineState.html#overChar"><span class="hs-identifier hs-type">overChar</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#beforeChar"><span class="hs-identifier hs-type">beforeChar</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#afterChar"><span class="hs-identifier hs-type">afterChar</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier hs-type">Char</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#InsertMode"><span class="hs-identifier hs-type">InsertMode</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-397"></span><span id="overChar"><span class="annot"><span class="annottext">overChar :: (Char -&gt; Bool) -&gt; InsertMode -&gt; Bool
</span><a href="System.Console.Haskeline.LineState.html#overChar"><span class="hs-identifier hs-var hs-var">overChar</span></a></span></span><span> </span><span id="local-6989586621679091392"><span class="annot"><span class="annottext">Char -&gt; Bool
</span><a href="#local-6989586621679091392"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="System.Console.Haskeline.LineState.html#IMode"><span class="hs-identifier hs-type">IMode</span></a></span><span> </span><span class="annot"><span class="annottext">[Grapheme]
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679091391"><span class="annot"><span class="annottext">Grapheme
</span><a href="#local-6989586621679091391"><span class="hs-identifier hs-var">y</span></a></span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span class="annot"><span class="annottext">[Grapheme]
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Char -&gt; Bool
</span><a href="#local-6989586621679091392"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Grapheme -&gt; Char
</span><a href="System.Console.Haskeline.LineState.html#baseChar"><span class="hs-identifier hs-var">baseChar</span></a></span><span> </span><span class="annot"><span class="annottext">Grapheme
</span><a href="#local-6989586621679091391"><span class="hs-identifier hs-var">y</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-398"></span><span class="annot"><a href="System.Console.Haskeline.LineState.html#overChar"><span class="hs-identifier hs-var">overChar</span></a></span><span> </span><span class="annot"><span class="annottext">Char -&gt; Bool
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">InsertMode
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-399"></span><span>
</span><span id="line-400"></span><span id="beforeChar"><span class="annot"><span class="annottext">beforeChar :: (Char -&gt; Bool) -&gt; InsertMode -&gt; Bool
</span><a href="System.Console.Haskeline.LineState.html#beforeChar"><span class="hs-identifier hs-var hs-var">beforeChar</span></a></span></span><span> </span><span id="local-6989586621679091390"><span class="annot"><span class="annottext">Char -&gt; Bool
</span><a href="#local-6989586621679091390"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="System.Console.Haskeline.LineState.html#IMode"><span class="hs-identifier hs-type">IMode</span></a></span><span> </span><span class="annot"><span class="annottext">[Grapheme]
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Grapheme
</span><span class="hs-identifier">_</span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span id="local-6989586621679091389"><span class="annot"><span class="annottext">Grapheme
</span><a href="#local-6989586621679091389"><span class="hs-identifier hs-var">y</span></a></span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span class="annot"><span class="annottext">[Grapheme]
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Char -&gt; Bool
</span><a href="#local-6989586621679091390"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Grapheme -&gt; Char
</span><a href="System.Console.Haskeline.LineState.html#baseChar"><span class="hs-identifier hs-var">baseChar</span></a></span><span> </span><span class="annot"><span class="annottext">Grapheme
</span><a href="#local-6989586621679091389"><span class="hs-identifier hs-var">y</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-401"></span><span class="annot"><a href="System.Console.Haskeline.LineState.html#beforeChar"><span class="hs-identifier hs-var">beforeChar</span></a></span><span> </span><span class="annot"><span class="annottext">Char -&gt; Bool
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">InsertMode
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-402"></span><span>
</span><span id="line-403"></span><span id="afterChar"><span class="annot"><span class="annottext">afterChar :: (Char -&gt; Bool) -&gt; InsertMode -&gt; Bool
</span><a href="System.Console.Haskeline.LineState.html#afterChar"><span class="hs-identifier hs-var hs-var">afterChar</span></a></span></span><span> </span><span id="local-6989586621679091388"><span class="annot"><span class="annottext">Char -&gt; Bool
</span><a href="#local-6989586621679091388"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="System.Console.Haskeline.LineState.html#IMode"><span class="hs-identifier hs-type">IMode</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679091387"><span class="annot"><span class="annottext">Grapheme
</span><a href="#local-6989586621679091387"><span class="hs-identifier hs-var">x</span></a></span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span class="annot"><span class="annottext">[Grapheme]
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Grapheme]
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Char -&gt; Bool
</span><a href="#local-6989586621679091388"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Grapheme -&gt; Char
</span><a href="System.Console.Haskeline.LineState.html#baseChar"><span class="hs-identifier hs-var">baseChar</span></a></span><span> </span><span class="annot"><span class="annottext">Grapheme
</span><a href="#local-6989586621679091387"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-404"></span><span class="annot"><a href="System.Console.Haskeline.LineState.html#afterChar"><span class="hs-identifier hs-var">afterChar</span></a></span><span> </span><span class="annot"><span class="annottext">Char -&gt; Bool
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">InsertMode
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-405"></span><span>
</span><span id="line-406"></span><span class="annot"><a href="System.Console.Haskeline.LineState.html#goRightUntil"><span class="hs-identifier hs-type">goRightUntil</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#goLeftUntil"><span class="hs-identifier hs-type">goLeftUntil</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="System.Console.Haskeline.LineState.html#InsertMode"><span class="hs-identifier hs-type">InsertMode</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#InsertMode"><span class="hs-identifier hs-type">InsertMode</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#InsertMode"><span class="hs-identifier hs-type">InsertMode</span></a></span><span>
</span><span id="line-407"></span><span id="goRightUntil"><span class="annot"><span class="annottext">goRightUntil :: (InsertMode -&gt; Bool) -&gt; InsertMode -&gt; InsertMode
</span><a href="System.Console.Haskeline.LineState.html#goRightUntil"><span class="hs-identifier hs-var hs-var">goRightUntil</span></a></span></span><span> </span><span id="local-6989586621679091386"><span class="annot"><span class="annottext">InsertMode -&gt; Bool
</span><a href="#local-6989586621679091386"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">InsertMode -&gt; InsertMode
</span><a href="#local-6989586621679091385"><span class="hs-identifier hs-var">loop</span></a></span><span> </span><span class="annot"><span class="annottext">(InsertMode -&gt; InsertMode)
-&gt; (InsertMode -&gt; InsertMode) -&gt; InsertMode -&gt; InsertMode
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">InsertMode -&gt; InsertMode
forall s. Move s =&gt; s -&gt; s
</span><a href="System.Console.Haskeline.LineState.html#goRight"><span class="hs-identifier hs-var">goRight</span></a></span><span>
</span><span id="line-408"></span><span>    </span><span class="hs-keyword">where</span><span>
</span><span id="line-409"></span><span>        </span><span id="local-6989586621679091385"><span class="annot"><span class="annottext">loop :: InsertMode -&gt; InsertMode
</span><a href="#local-6989586621679091385"><span class="hs-identifier hs-var hs-var">loop</span></a></span></span><span> </span><span id="local-6989586621679091382"><span class="annot"><span class="annottext">im :: InsertMode
</span><a href="#local-6989586621679091382"><span class="hs-identifier hs-var">im</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="System.Console.Haskeline.LineState.html#IMode"><span class="hs-identifier hs-type">IMode</span></a></span><span> </span><span class="annot"><span class="annottext">[Grapheme]
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621679091381"><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091381"><span class="hs-identifier hs-var">ys</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">[Grapheme] -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#null"><span class="hs-identifier hs-var">null</span></a></span><span> </span><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091381"><span class="hs-identifier hs-var">ys</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">||</span></span><span> </span><span class="annot"><span class="annottext">InsertMode -&gt; Bool
</span><a href="#local-6989586621679091386"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">InsertMode
</span><a href="#local-6989586621679091382"><span class="hs-identifier hs-var">im</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">InsertMode
</span><a href="#local-6989586621679091382"><span class="hs-identifier hs-var">im</span></a></span><span>
</span><span id="line-410"></span><span>                             </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">InsertMode -&gt; InsertMode
</span><a href="#local-6989586621679091385"><span class="hs-identifier hs-var">loop</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">InsertMode -&gt; InsertMode
forall s. Move s =&gt; s -&gt; s
</span><a href="System.Console.Haskeline.LineState.html#goRight"><span class="hs-identifier hs-var">goRight</span></a></span><span> </span><span class="annot"><span class="annottext">InsertMode
</span><a href="#local-6989586621679091382"><span class="hs-identifier hs-var">im</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-411"></span><span id="goLeftUntil"><span class="annot"><span class="annottext">goLeftUntil :: (InsertMode -&gt; Bool) -&gt; InsertMode -&gt; InsertMode
</span><a href="System.Console.Haskeline.LineState.html#goLeftUntil"><span class="hs-identifier hs-var hs-var">goLeftUntil</span></a></span></span><span> </span><span id="local-6989586621679091378"><span class="annot"><span class="annottext">InsertMode -&gt; Bool
</span><a href="#local-6989586621679091378"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">InsertMode -&gt; InsertMode
</span><a href="#local-6989586621679091377"><span class="hs-identifier hs-var">loop</span></a></span><span> </span><span class="annot"><span class="annottext">(InsertMode -&gt; InsertMode)
-&gt; (InsertMode -&gt; InsertMode) -&gt; InsertMode -&gt; InsertMode
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">InsertMode -&gt; InsertMode
forall s. Move s =&gt; s -&gt; s
</span><a href="System.Console.Haskeline.LineState.html#goLeft"><span class="hs-identifier hs-var">goLeft</span></a></span><span>
</span><span id="line-412"></span><span>    </span><span class="hs-keyword">where</span><span>
</span><span id="line-413"></span><span>        </span><span id="local-6989586621679091377"><span class="annot"><span class="annottext">loop :: InsertMode -&gt; InsertMode
</span><a href="#local-6989586621679091377"><span class="hs-identifier hs-var hs-var">loop</span></a></span></span><span> </span><span id="local-6989586621679091374"><span class="annot"><span class="annottext">im :: InsertMode
</span><a href="#local-6989586621679091374"><span class="hs-identifier hs-var">im</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="System.Console.Haskeline.LineState.html#IMode"><span class="hs-identifier hs-type">IMode</span></a></span><span> </span><span id="local-6989586621679091373"><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091373"><span class="hs-identifier hs-var">xs</span></a></span></span><span> </span><span class="annot"><span class="annottext">[Grapheme]
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span>   </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">[Grapheme] -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#null"><span class="hs-identifier hs-var">null</span></a></span><span> </span><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679091373"><span class="hs-identifier hs-var">xs</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">||</span></span><span> </span><span class="annot"><span class="annottext">InsertMode -&gt; Bool
</span><a href="#local-6989586621679091378"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">InsertMode
</span><a href="#local-6989586621679091374"><span class="hs-identifier hs-var">im</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">InsertMode
</span><a href="#local-6989586621679091374"><span class="hs-identifier hs-var">im</span></a></span><span>
</span><span id="line-414"></span><span>                            </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">InsertMode -&gt; InsertMode
</span><a href="#local-6989586621679091377"><span class="hs-identifier hs-var">loop</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">InsertMode -&gt; InsertMode
forall s. Move s =&gt; s -&gt; s
</span><a href="System.Console.Haskeline.LineState.html#goLeft"><span class="hs-identifier hs-var">goLeft</span></a></span><span> </span><span class="annot"><span class="annottext">InsertMode
</span><a href="#local-6989586621679091374"><span class="hs-identifier hs-var">im</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-415"></span><span>
</span><span id="line-416"></span></pre></body></html>